A lens diopter detection method, system, intelligent terminal and storage medium

CN118982819BActive Publication Date: 2026-10-13NINGBO MING SING OPTICAL R & D
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

[0004]针对上述中的相关技术,测量透镜的屈光度时,需要缓慢移动分划板,从而精准控制分划板准确移动至透镜的焦点位置,然后在测量焦距计算屈光度,造成透镜屈光度的检测步骤过于繁琐,导致镜片屈光度的检测效率低,还有改进的空间

Benefits of technology

1.通过根据镜片的图像数据集信息和模型算法构建屈光度检测模型,从而在后续检测镜片的屈光度时,仅需要将镜片的需检测图像数据信息输入屈光度检测模型中,即可得到镜片的实际屈光度信息,而不需要人员移动分划板去测量透镜的焦距,进而提高镜片屈光度的检测效率;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118982819B_ABST
    Figure CN118982819B_ABST
Patent Text Reader

Abstract

The application 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, which comprises the following steps: acquiring image dataset information of a lens; constructing a diopter detection model according to the image dataset information and a preset model algorithm; acquiring image data information to be detected of the lens; and inputting the image data information to be detected into the diopter detection model to predict actual diopter information of the lens. The application has the effect of improving the detection efficiency of the lens diopter.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent medical technology, and in particular to a method, system, intelligent terminal and storage medium for detecting lens refractive power. Background Technology

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

[0003] In related technologies, the refractive power of a lens is detected by a focimeter. First, the collimation system is controlled to convert the light beam generated by the light source into a parallel beam, which is then passed through the lens and illuminates the reticle. Then, the reticle is moved and the image on the reticle is observed through an observation system. When the image is clearly visible, it indicates that the reticle is at the focal point of the lens. The distance between the reticle and the lens is then measured to obtain the focal length of the lens. Finally, the reciprocal of the focal length is calculated to obtain the refractive power of the lens.

[0004] Regarding the aforementioned technologies, measuring the refractive power of a lens requires slowly moving the reticle to precisely control its movement to the focal point of the lens before measuring the focal length and calculating the refractive power. This makes the lens refractive power measurement process overly cumbersome, resulting in low efficiency and room for improvement. Summary of the Invention

[0005] To improve the efficiency of lens refractive power detection, this application provides a lens refractive power detection method, system, smart terminal, and storage medium.

[0006] In a first aspect, this application provides a method for detecting the refractive power of a lens, employing the following technical solution: A method for measuring the refractive power of a lens includes: Obtain the image dataset information of the lens; A refractive error detection model is constructed based on image dataset information and a pre-defined model algorithm; Obtain the image data information of the lens to be detected; The image data to be detected is input into the refractive error detection model to predict the actual refractive error of the lens.

[0007] By adopting the above technical solution, a refractive error detection model is constructed based on the image dataset information and model algorithm of the lens. Therefore, when detecting the refractive error of the lens in the future, it is only necessary to input the image data information of the lens to be detected into the refractive error detection model to obtain the actual refractive error information of the lens, without the need for personnel to move the reticle to measure the focal length of the lens, thereby improving the detection efficiency of lens refractive error.

[0008] Optionally, the steps for obtaining the image dataset information of the lens include: Obtain the original image information of the lens; Determine whether the original image information meets the preset requirements for stain image information; If the conditions are met, the original image information is discarded, and the next original image information is obtained to continuously judge the process. If it does not meet the requirements, the original image information will be preprocessed according to the preset image preprocessing method to generate processed image information; Obtain the diopter parameter information corresponding to the original image information; The refractive power parameter information is annotated onto the image corresponding to the processed image information to generate annotated image information; Input the labeled image information into the preset dataset to generate image dataset information.

[0009] By adopting the above technical solution, when the original image information meets the requirements of the stain image information, the original image information is removed, 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 power parameter information is annotated on the processed image information to generate annotated image information. Finally, the annotated image information is input into the dataset to generate image dataset information, thereby ensuring the quality of image data and improving the accuracy of the subsequently constructed model.

[0010] Optionally, the step of preprocessing the original image information according to a preset image preprocessing method to generate processed image information includes: The original image information is selected by sliding a box in the preset processing window to generate feature information to be processed; The grayscale value information is determined by analyzing the feature information to be processed. The grayscale value information is used to convert the feature information to grayscale to generate grayscale feature information; The median pixel information is determined by analyzing the grayscale feature information. Denoising is performed on grayscale feature information based on median pixel information to generate denoised feature information; The local threshold information is determined by analyzing the grayscale value information and the preset threshold constant information. The noise reduction feature information is binarized based on local threshold information to generate processed image information.

[0011] By adopting the above technical solution, the original image information is selected by sliding the processing window to generate the feature information to be processed. After determining the grayscale value information based on the feature information to be processed, the pixels corresponding to the feature information are grayscaled to obtain grayscale feature information, thereby removing the interference of color information on subsequent processing. Then, the median pixel information is determined based on the grayscale feature information, thereby adjusting the grayscale feature information to the median pixel information to eliminate impulse interference and random noise in the image. Finally, the noise reduction feature information is binarized based on the local threshold information to generate the processed image information, thereby segmenting the foreground target from the background and improving the convenience of subsequent feature extraction.

[0012] Optionally, the step of inputting labeled image information into a preset dataset to generate image dataset information includes: Input the labeled image information into the dataset to generate the basic dataset information; Determine whether the basic dataset information meets the preset requirements for complete dataset information; If it does not match, continue to acquire the original image information to supplement the basic dataset information; If the conditions are met, then the basic dataset information is determined to be image dataset information.

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

[0014] Optionally, the steps for constructing a refractive error detection model based on image dataset information and a pre-defined model algorithm include: Based on the image dataset information, images are selected one by one to determine the training Hartmann aperture image information and the corresponding training diopter data information; Feature analysis is performed based on the training Hartmann aperture image information to generate the centroid coordinate information of the light spot; A basic detection model is constructed based on the model algorithm and the preset initial hyperparameter information; After training the basic detection model based on the centroid coordinates of the light spot and the corresponding training refractive power data, the detection model to be optimized is determined. The hyperparameters of the detection model to be optimized are optimized according to the preset hyperparameter optimization method to determine the refractive power detection model.

[0015] By adopting the above technical solution, the basic detection model is trained based on the centroid coordinate information of the light spot and the training diopter data to determine the detection model to be optimized. Then, the hyperparameters of the detection model to be optimized are optimized according to the hyperparameter optimization method to determine the diopter detection model, thereby improving the detection performance of the diopter detection model.

[0016] Optionally, 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; Images are selected one by one based on the image dataset information to determine the verification dataset information; Based on the validation dataset 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 optimize the detection model to be optimized to determine the optimal hyperparameter combination information. The optimal hyperparameter combination information is used to retrain the detection model to be optimized to determine the refractive power detection model.

[0017] By adopting the above technical solution, when training the detection model to be optimized using the validation dataset information, the hyperparameter optimization framework optimizes the hyperparameters of the detection model to be optimized within the hyperparameter optimization space information with the objective function information as the optimization target, thereby determining the optimal hyperparameter combination information. The optimal hyperparameter combination information is then used to retrain the detection model to be optimized 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 based on the optimal hyperparameter combination information to determine the refractive error detection model includes: The optimal detection model is determined by optimizing the detection model to be optimized based on the information of the optimal hyperparameter combination. Images are selected one by one based on the image dataset information to determine the test dataset information; The optimized detection model is evaluated based on the test dataset information to generate evaluation parameter information; Determine whether the evaluation parameter information meets the preset requirements for the evaluation parameter information; If the conditions are met, the optimized detection model is determined to be the refractive error detection model; If it does not meet the requirements, an analysis will be conducted based on the assessment parameter information and the demand assessment parameter information to determine the hyperparameter information to be adjusted. The hyperparameters of the optimized detection model are optimized based on the adjusted hyperparameter information.

[0019] By adopting the above technical solution, the optimized detection model is obtained by optimizing the detection model to be optimized based on the optimal hyperparameter combination information. Then, the optimized detection model is evaluated based on the test dataset 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 both. Thus, the optimized detection model is hyperparameter optimized based on the adjusted hyperparameter information, thereby improving the accuracy of the refractive power detection model.

[0020] Secondly, this application provides a lens refractive power detection system, which adopts the following technical solution: A lens refractive power measurement system, comprising: The acquisition module is used to acquire image dataset information and image data information to be detected; A memory for storing a program for a lens refractive power detection method as described in any of the preceding claims; The processor and 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 of the above.

[0021] By adopting the above technical solution, the processor loads and executes a program for a lens refractive power detection method stored in the memory, thereby controlling the acquisition module to acquire a series of data related to 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 lens refractive power.

[0022] Thirdly, this application provides a smart terminal, which adopts the following technical solution: A smart terminal includes a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and executed as described in any of the preceding claims for a lens refractive power detection method.

[0023] By adopting the above technical solution, the processor loads and executes a program for a lens refractive power detection method stored in the memory through the operation of a smart terminal. This inputs the image data information of the lens to be detected into the refractive power detection model, predicts the actual refractive power information, and thus improves the detection efficiency of lens refractive power.

[0024] Fourthly, this application provides a computer storage medium capable of storing corresponding programs, which facilitates improving the detection efficiency of lens refractive power, and adopts the following technical solution: A computer-readable storage medium storing a computer program that can be loaded by a processor and executed any of the above-described 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. The 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 the refractive power detection model, predicting the actual refractive power information, and thus improving the detection efficiency of lens refractive power.

[0026] In summary, this application includes at least one of the following beneficial technical effects: 1. By constructing a refractive power detection model based on the image dataset information and model algorithm of the lens, when detecting the refractive power of the lens in the future, 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 reticle to measure the focal length of the lens, thereby improving the detection efficiency of lens refractive power; 2. After generating basic dataset information by inputting labeled image information into the dataset, if the basic dataset information meets the requirements of complete dataset information, the basic dataset information is determined to be image dataset information, thereby ensuring that the image dataset information contains enough samples for subsequent training models, thus improving the applicability of the image dataset information. 3. After training the basic detection model based on the centroid coordinates of the light spot and the training diopter data, the detection model to be optimized is determined. Then, the hyperparameters of the detection model to be optimized are optimized according to the hyperparameter optimization method to determine the diopter detection model, thereby improving the detection performance of the diopter detection model. Attached Figure Description

[0027] Figure 1 This is a flowchart of a lens refractive power detection method according to an embodiment of this application.

[0028] Figure 2 This is a flowchart of the steps for obtaining image dataset information of the lens in an embodiment of this application.

[0029] Figure 3 This is a flowchart illustrating the steps in this application embodiment of preprocessing original image information according to a preset image preprocessing method to generate processed image information.

[0030] Figure 4 This is a flowchart of the steps in this application embodiment to input labeled image information into a preset dataset to generate image dataset information.

[0031] Figure 5 This is a flowchart of the steps in this application embodiment to construct a refractive error detection model based on image dataset information and a preset model algorithm.

[0032] Figure 6This is a flowchart illustrating the steps in this application embodiment to perform hyperparameter optimization on the detection model to be optimized according to a preset hyperparameter optimization method to determine the refractive power detection model.

[0033] Figure 7 This is a flowchart of the steps in this application embodiment to retrain the detection model to be optimized based on the optimal hyperparameter combination information to determine the refractive power detection model. Detailed Implementation

[0034] To make the purpose, technical solution, and advantages of this application clearer, the following description is provided in conjunction with the appendix. Figures 1-7 The present application will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the application.

[0035] This application discloses a rapid method for detecting the refractive power of a lens. The method includes a processing terminal that receives image dataset information and constructs a refractive power detection model based on the image dataset information and a model algorithm. After receiving the image data information of the lens to be detected, the processing terminal inputs this information into the refractive power detection model to predict the actual refractive power of the lens. This eliminates the need for personnel to move the reticle on a focimeter to measure the focal length and calculate the refractive power of the lens, thereby improving the efficiency of lens refractive power detection.

[0036] Reference Figure 1 This application discloses a method for detecting the refractive power of a lens, comprising the following steps: Step S100: Obtain the image dataset information of the lens.

[0037] The image dataset information refers to Hartmann aperture images at different refractive power levels, covering various refractive power levels from myopia to hyperopia. These images can be obtained through actual optical experiments and input into the processing terminal. Specific methods are detailed in [reference needed]. Figure 2 The steps.

[0038] Step S101: Construct a refractive error detection model based on the image dataset information and the preset model algorithm.

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

[0040] The refractive error detection model refers to a machine learning model used to predict the refractive power of a lens. The processing terminal trains the model algorithm based on the correspondence between the centroid coordinates of the light spot and the refractive power in the Hartmann stop image corresponding to the image dataset information. For specific methods, please refer to [link / reference]. Figure 5 The steps.

[0041] Step S102: Obtain the image data information of the lens to be detected.

[0042] The image data to be detected refers to the Hartmann aperture image of the lens for which the diopter needs to be detected. This image is captured by the operator using a Hartmann-Shack sensor and uploaded to the processing terminal. The processing terminal performs image preprocessing on the image, and the image preprocessing method is described in [reference needed]. Figure 3 The logic behind the steps will not be elaborated here.

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

[0044] The actual refractive power information refers to the actual refractive power of the lens to be tested. After the operator uploads the image data to be tested to the processing terminal, the processing terminal uses connected components to extract the contour and calculate the area based on the Hartmann stop image corresponding to the image data to be tested, thereby obtaining the geometric features of the light spot. Then, using the moment calculation method, combined with the pixel grayscale distribution of the light spot area, the centroid coordinates of the light spot are calculated. Since the grayscale 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 to be tested are used as features input 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.

[0045] Reference Figure 2 The steps to obtain the image dataset information of the lens include: Step S200: Obtain the original image information of the lens.

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

[0047] Step S201: Determine whether the original image information meets the preset requirements for stain image information.

[0048] Here, stain image information refers to images containing stain characteristics, stored by the operator in the processing terminal. The requirement for stain image information is that it contains stain characteristics corresponding to the stain image information.

[0049] The processing terminal determines whether the image features corresponding to the original image information, such as the stain features corresponding to the stain image information, are clean and free of stains, thus determining whether the Hartmann stop image of the lens is clean and free of stains, without interfering with the feature extraction of subsequent images.

[0050] Step S2011: If the condition is met, the original image information is discarded, and the next original image information is obtained for cyclical judgment.

[0051] 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. Since the stain features will interfere with feature extraction in the subsequent feature extraction process, the original image information is removed, and the next original image information is detected.

[0052] Step S2012: If it does not meet the requirements, then perform image preprocessing on the original image information according to the preset image preprocessing method to generate processed image information.

[0053] 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 indicates that there are no stain features in the Hartmann aperture image of the lens. Therefore, there will be no stains interfering with feature extraction. Thus, the original image information is preprocessed according to the image preprocessing method to generate processed image information, which facilitates subsequent feature extraction of the image.

[0054] Image preprocessing methods refer to methods used to preprocess images to make them more suitable for feature extraction. These methods are stored in the processing terminal by the operator. Processed image information refers to images corresponding to the original image information that have been preprocessed to facilitate subsequent feature extraction. This is obtained by the processing terminal performing image preprocessing on the images corresponding to the original image information according to the image preprocessing methods. Specific methods are described in [reference needed]. Figure 3 The steps.

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

[0056] The diopter parameter information refers to the diopter corresponding to the original image information. It is obtained by inputting the diopter of the lens into the processing terminal at the same time as the operator inputs the original image information of the lens.

[0057] Step S20122: Annotate the refractive power parameter information onto the image corresponding to the processed image information to generate annotated image information.

[0058] The labeled image information refers to the Hartmann aperture image that has undergone image preprocessing and is labeled with refractive power. The processing terminal labels the refractive power corresponding to the refractive power parameter information in the image corresponding to the processed image information.

[0059] Step S20123: Input the labeled image information into the preset dataset to generate image dataset information.

[0060] Here, the dataset refers to a set of blank image data used to store the Hartmann aperture image of the lens, forming the image dataset information. The image dataset information in this step is consistent with the image dataset information in step S100, generated by the processing terminal inputting and storing the labeled image information in the dataset; the specific method is described in [reference needed]. Figure 4 The steps.

[0061] Reference Figure 3 The steps for preprocessing the original image information according to a preset image preprocessing method to generate processed image information include: Step S300: Select the original image information by sliding the box in the preset processing window to generate the feature information to be processed.

[0062] The processing window refers to a window used to capture local features of an image, and its size is an odd number. The feature information to be processed refers to the image features to be preprocessed. It is obtained by the processing terminal controlling the processing window to slide and select on the image corresponding to the original image information. After processing each selected feature, the window 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 grayscale value information.

[0064] Among them, grayscale information refers to the grayscale value used to convert each pixel corresponding to the feature information to be processed into grayscale. The processing terminal identifies the three color values ​​of the pixel and then calculates the average value of the three color values ​​to obtain the grayscale value of the pixel.

[0065] Step S302: Perform grayscale processing on the feature information to be processed based on the grayscale value information to generate grayscale feature information.

[0066] Among them, grayscale feature information refers to the image features after grayscale conversion of the image features corresponding to the feature information to be processed. After obtaining the grayscale value information of the pixels in the feature information to be processed, the processing terminal replaces the three color values ​​of the pixels with the grayscale value corresponding to the grayscale value information, thereby removing the image color and preventing interference to subsequent 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 value to obtain the median pixel information.

[0069] Step S304: Denoise the grayscale feature information based on the median pixel information to generate denoised feature information.

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

[0071] Step S305: Analyze the grayscale 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 gray-scale mean binarization of image features, and the specific value is determined by the operator based on the actual situation. The local threshold information refers to the threshold used for comparison with the pixel values ​​of pixels in the image features, and is obtained by adding the constant corresponding to the threshold constant information to the gray-scale value information provided by the processing terminal.

[0073] Step S306: Binarize the noise reduction feature information based on the local threshold information to generate processed image information.

[0074] In this step, the processed image information is the same as that in step S2012. The processing terminal compares the pixel value of the pixel in the noise reduction feature information with the local threshold information. If the pixel value is greater than the threshold corresponding to the local threshold information, the pixel value is replaced with the value corresponding to white, i.e., 225. If the pixel value is not greater than the threshold corresponding to the local threshold information, the pixel value is replaced with the value corresponding to black, i.e., 0. This generates processed image information, which segments the foreground and background of the image, facilitating subsequent feature extraction.

[0075] Reference Figure 4 The steps for inputting labeled image information into a preset dataset to generate image dataset information include: Step S400: Input the labeled image information into the dataset to generate basic dataset information.

[0076] Among them, the basic dataset information refers to the image dataset that stores image data that has not been verified as being suitable for use as training samples. It is generated by the processing terminal by inputting the image data corresponding to the labeled image information into the dataset.

[0077] Step S401: Determine whether the basic dataset information meets the preset requirements for complete dataset information.

[0078] In this context, "complete dataset information" refers to an image dataset containing a sufficient amount of image data, stored by the operator in the processing terminal. The requirement for complete dataset information is that it must be no less than the number of data points corresponding to complete dataset information.

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

[0080] Step S4011: If it does not meet the requirements, continue to obtain the original image information to supplement the basic dataset information.

[0081] If the processing terminal determines that the amount of data corresponding to the basic dataset information is less than the amount of data corresponding to the complete dataset information, it indicates that training the model with the current basic dataset information is likely to result in low model accuracy. Therefore, the original image information is further detected to supplement the basic dataset information.

[0082] Step S4012: If the conditions are met, then the basic dataset information is determined to be image dataset information.

[0083] If the processing terminal determines that the number of data corresponding to the basic dataset information is not less than the number of data corresponding to the complete dataset information, it indicates that the number of data in the current basic dataset information meets the training requirements of the model, and therefore the basic dataset information is determined to be image dataset information.

[0084] Reference Figure 5 The steps for constructing a refractive error detection model based on image dataset information and a pre-defined model algorithm include: Step S500: Select images one by one according to the image dataset information to determine the training Hartman aperture image information and the corresponding training diopter data information.

[0085] The training Hartmann aperture image information refers to the data samples used to train the model algorithm, which are obtained by the processing terminal from the image dataset information in sequence. The training diopter data information refers to the diopter corresponding to the training Hartmann aperture image, which is used as the target to train the model algorithm. When the processing terminal calls the training Hartmann aperture image information, it identifies the image annotations to obtain the diopter.

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

[0087] Among them, the centroid coordinate information of the light spot refers to the position of the light spot in the image corresponding to the training Hartman aperture image information. As a feature training model algorithm, the processing terminal performs contour extraction and area calculation using connected components based on the image corresponding to the training Hartman aperture image information to obtain the geometric features of the light spot. Through the moment calculation method, combined with the pixel gray-level distribution of the light spot area, the centroid coordinates of the light spot are calculated. Since the gray level reflects the distribution of light intensity, the gray-level 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 based on the model algorithm and the preset initial hyperparameter information.

[0089] The initial hyperparameter information refers to the items and values ​​of machine learning hyperparameters, including the maximum depth of input, which is used to control the complexity of the model and can improve generalization ability if chosen reasonably; the minimum number of samples in the leaf nodes, which prevents overfitting and ensures 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; and also includes regularization coefficients and feature subsampling rates, etc. The specific values ​​are determined by the operator according to the actual situation.

[0090] The basic detection model refers to the model algorithm that has been initialized with hyperparameters. The processing terminal adjusts the model algorithm based on the items and values ​​corresponding to the initial hyperparameter information.

[0091] Step S503: After training the basic detection model based on the centroid coordinates of the light spot and the corresponding training refractive power data, determine the detection model to be optimized.

[0092] The detection model to be optimized refers to the basic detection model after training. The processing terminal inputs the coordinates corresponding to the centroid coordinates of the light spot as features into the basic detection model to calculate the predicted output. The loss function is used to compare the refractive power corresponding to the training refractive power data with the predicted output to obtain the quantization error. Then, the gradient of the loss function with respect to the model parameters is calculated. The parameters of the basic detection model are updated according to the gradient using gradient descent until the model converges, thus obtaining the detection model to be optimized.

[0093] Step S504: Perform hyperparameter optimization on the detection model to be optimized according to the preset hyperparameter optimization method to determine the refractive power detection model.

[0094] Among them, hyperparameter optimization methods refer to methods for optimizing the hyperparameters of the model, which are stored by the operator in the processing terminal, as detailed in [reference needed]. Figure 6 The steps are as follows. The refractive error detection model in this step is obtained by the processing terminal optimizing the hyperparameters of the detection model to be optimized using a hyperparameter optimization method. For specific methods, please refer to [link / reference]. Figure 6 The steps.

[0095] Reference Figure 6 The steps for determining the refractive power detection model by optimizing the hyperparameters of the detection model to be optimized according to the preset hyperparameter optimization method 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, learning rate, regularization strength, minimum number of samples in the leaf nodes, and feature subsampling rate, etc. The hyperparameter optimization space information refers to the reasonable range of values ​​for different hyperparameters. Both are input into the processing terminal by the operator.

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

[0098] The validation dataset information refers to a dataset that includes the centroid coordinates of the light spot as validation data samples and the corresponding refractive power. The processing terminal selects Hartmann aperture images and corresponding refractive power data one by one from the data corresponding to the image dataset information, and then extracts the centroid coordinates of the light spot and the corresponding refractive power of the Hartmann aperture images to form a validation dataset, thereby providing training samples for subsequent optimization of the detection model to be optimized.

[0099] Step S602: Based on the validation dataset information, the preset objective function information, and the preset hyperparameter optimization framework, the hyperparameter information to be optimized and the hyperparameter optimization space information, perform hyperparameter optimization on the detection model to be optimized to determine the optimal hyperparameter combination information.

[0100] The objective function information refers to the target of model hyperparameter optimization. In this application, the mean absolute error of the model on the validation set is used as the objective function for hyperparameter optimization. The mean absolute error reflects the deviation between the model's prediction results and the actual values, and is an important indicator for evaluating the accuracy of refractive power detection. The hyperparameter optimization framework refers to a hyperparameter optimization library used to explore the optimal combination of hyperparameters. In this application, Optuna is used as the hyperparameter optimization framework.

[0101] The optimal hyperparameter combination information refers to the hyperparameter combination that minimizes the 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. When the detection model to be optimized is trained on the explored hyperparameter combination with the verification dataset information, the mean absolute error corresponding to the objective function information is minimized. Then, the hyperparameter combination at this time is determined to be the optimal solution.

[0102] Step S603: Retrain the detection model to be optimized based on the optimal hyperparameter combination information to determine the refractive power detection model.

[0103] In this step, the refractive error detection model is determined by the processing terminal transmitting the hyperparameters corresponding to the optimal hyperparameter combination information to the model via a hard-coded configuration file. The model is then retrained with the hyperparameters changed to determine the final model. The specific method is described in [reference needed]. Figure 7 The steps.

[0104] Reference Figure 7 The steps for retraining the detection model to be optimized based on the optimal hyperparameter combination information to determine the refractive power detection model include: Step S700: Optimize the detection model to be optimized based on the optimal hyperparameter combination information to determine the optimal detection model.

[0105] Among them, the optimized detection model refers to the model that has undergone hyperparameter optimization. The processing terminal transmits the hyperparameters corresponding to the optimal hyperparameter combination information to the model through a hard-coded configuration file.

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

[0107] The test dataset information refers to the dataset that includes the centroid coordinates of the light spot as the test data sample and the corresponding refractive power. The processing terminal selects Hartmann aperture images and corresponding refractive power data one by one from the data corresponding to the image dataset information, and then extracts the centroid coordinates of the light spot and the corresponding refractive power of the Hartmann aperture image to form the test dataset, thereby providing training samples for subsequent retraining and optimization of the detection model.

[0108] Step S702: Evaluate the optimized detection model based on the test dataset information to generate evaluation parameter information.

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

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

[0111] In this context, demand assessment parameters refer to the corresponding objectives that different assessment projects need to achieve. The specific objectives for each project are determined by the operators based on actual needs. The requirements for these demand assessment parameters refer to achieving the objectives corresponding to those parameters.

[0112] By determining whether the parameters corresponding to the evaluation parameter information meet the target corresponding to the requirement evaluation parameter information, it can be determined whether the model after optimizing the hyperparameters meets the usage requirements.

[0113] Step S7031: If the conditions are met, then the optimized detection model is determined to be the refractive error detection model.

[0114] If the processing terminal determines that the parameters corresponding to the evaluation parameter information meet the target corresponding to the requirement evaluation parameter information, it indicates that the accuracy, inference speed and robustness of the model meet the requirements for use. Therefore, the optimized detection model is determined to be the refractive error detection model.

[0115] Step S7032: If it does not meet the requirements, analyze the assessment parameter information and the demand assessment parameter information to determine the hyperparameter information to be adjusted.

[0116] If the processing terminal determines that the parameters corresponding to the evaluation parameter information do not meet the target corresponding to the demand evaluation parameter information, it indicates that there are items in the model's accuracy, inference speed, and robustness that do not meet the usage requirements. Therefore, the hyperparameter information is adjusted based on the evaluation parameter information and the demand evaluation parameter information to provide data support for subsequent hyperparameter adjustments.

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

[0118] Step S70321: Optimize the hyperparameters of the detection model based on the adjusted hyperparameter information.

[0119] After the processing terminal determines the hyperparameter adjustment information, the optimized detection model is optimized again based on the hyperparameters corresponding to the adjusted hyperparameter information. The specific logic is the same as... Figure 6 The steps are the same and will not be repeated here. The model is determined as the refractive error detection model when all the evaluation parameters meet the target of the required evaluation parameters.

[0120] Based on the same inventive concept, embodiments of the present invention provide a lens refractive power detection system, comprising: The acquisition module is used to acquire image dataset 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 used to store a program for a method of detecting lens refractive power; The processor is a program in memory that can be loaded and executed by the processor to implement a method for detecting lens refractive power.

[0121] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be 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 be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0122] This invention provides a computer-readable storage medium storing a computer program that can be loaded by a processor and executed as a method for detecting the refractive power of a lens.

[0123] Computer storage media include, for example, USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media that can store program code.

[0124] Based on the same inventive concept, embodiments of the present invention provide a smart terminal, including a memory and a processor, wherein the memory stores a computer program that can be loaded and executed by the processor to perform a lens refractive power detection method.

[0125] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be 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 be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0126] The above are all preferred embodiments of this application and are not intended to limit the scope of protection of this application. Any feature disclosed in this specification (including the abstract and drawings) may be replaced by other equivalent or similar features unless specifically stated otherwise. That is, unless specifically stated otherwise, each feature is only one 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: Obtain the image dataset information of the lens; A refractive error detection model is constructed based on image dataset information and a pre-defined model algorithm; Obtain the image data information of the lens to be detected; The image data to be detected is input into the refractive error detection model to predict the actual refractive error of the lens; The steps for obtaining the image dataset information of the lens include: obtaining the original image information of the lens; determining whether the original image information meets the preset requirements for stain image information; if it meets the requirements, discarding the original image information and continuing to obtain the next original image information for iterative judgment; if it does not meet the requirements, performing image preprocessing on the original image information according to the preset image preprocessing method to generate processed image information; obtaining the refractive power parameter information corresponding to the original image information; annotating the refractive power parameter information on the image corresponding to the processed image information to generate annotated image information; and inputting the annotated image information into the preset dataset to generate image dataset information. The steps of preprocessing the original image information to generate processed image information according to a preset image preprocessing method include: selecting the original image information by sliding a box in a preset processing window to generate feature information to be processed; analyzing the feature information to be processed to determine grayscale value information; performing grayscale processing on the feature information to be processed based on the grayscale value information to generate grayscale feature information; analyzing the grayscale feature information to determine median pixel information; performing noise reduction on the grayscale feature information based on the median pixel information to generate noise-reduced feature information; analyzing the grayscale value information and preset threshold constant information to determine local threshold information; and binarizing the noise-reduced feature information based on the local threshold information to generate processed image information. The steps of inputting labeled image information into a preset dataset to generate image dataset information include: inputting labeled image information into the dataset to generate basic dataset information; determining whether the basic dataset information meets the preset requirements for complete dataset information; if it does not meet the requirements, continuing to acquire original image information to supplement the basic dataset information; if it meets the requirements, determining the basic dataset information as image dataset information.

2. The method for detecting lens refractive power according to claim 1, characterized in that, The steps for constructing a refractive error detection model based on image dataset information and a pre-defined model algorithm include: Based on the image dataset information, images are selected one by one to determine the training Hartmann aperture image information and the corresponding training diopter data information; Feature analysis is performed based on the training Hartmann aperture image information to generate the centroid coordinate information of the light spot; A basic detection model is constructed based on the model algorithm and the preset initial hyperparameter information; After training the basic detection model based on the centroid coordinates of the light spot and the corresponding training refractive power data, the detection model to be optimized is determined. The hyperparameters of the detection model to be optimized are optimized according to the preset hyperparameter optimization method to determine the refractive power detection model.

3. The method for detecting lens refractive power according to claim 2, characterized in that, The steps for determining the refractive power detection model by optimizing the hyperparameters of the detection model to be optimized according to the preset hyperparameter optimization method include: Obtain the hyperparameter information to be optimized and the corresponding hyperparameter optimization space information of the detection model to be optimized; Images are selected one by one based on the image dataset information to determine the verification dataset information; Based on the validation dataset 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 optimize the detection model to be optimized to determine the optimal hyperparameter combination information. The optimal hyperparameter combination information is used to retrain the detection model to be optimized to determine the refractive power detection model.

4. The method for detecting lens refractive power according to claim 3, characterized in that, The steps for retraining the detection model to be optimized based on the optimal hyperparameter combination information to determine the refractive power detection model include: The optimal detection model is determined by optimizing the detection model to be optimized based on the information of the optimal hyperparameter combination. Images are selected one by one based on the image dataset information to determine the test dataset information; The optimized detection model is evaluated based on the test dataset information to generate evaluation parameter information; Determine whether the evaluation parameter information meets the preset requirements for the evaluation parameter information; If the conditions are met, the optimized detection model is determined to be the refractive error detection model; If it does not meet the requirements, an analysis will be conducted based on the assessment parameter information and the demand assessment parameter information to determine the hyperparameter information to be adjusted. The hyperparameters of the optimized detection model are optimized based on the adjusted hyperparameter information.

5. A lens refractive power detection system, characterized in that, include: The acquisition module is used to acquire image dataset information and image data information to be detected; A memory for storing a program for a lens refractive power detection method as described in any one of claims 1 to 4; The processor and the program in the memory can be loaded and executed by the processor to implement the lens refractive power detection method as described in any one of claims 1 to 4.

6. A smart terminal, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and executed as described in any one of claims 1 to 4 for a method of detecting lens refractive power.

7. A computer-readable storage medium, characterized in that, The device contains a computer program that can be loaded by a processor and executed as described in any one of claims 1 to 4 for measuring lens refractive power.

Citation Information

Patent Citations

  • Diopter measuring system and method and computer optometry unit

    CN115414000A

  • Glasses diopter identification method and apparatus, electronic device and storage medium

    WO2024120179A1