Model construction method, tear river height measurement method, device and storage medium

By constructing and training a human eye image segmentation model, the problem of inaccurate tear river height measurement was solved, enabling accurate assessment of patients' dry eye symptoms.

CN116758375BActive Publication Date: 2026-07-03ZD MEDICAL (HANGZHOU) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZD MEDICAL (HANGZHOU) CO LTD
Filing Date
2023-06-30
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Current technologies for measuring tear height have low accuracy and cannot accurately determine the progression of dry eye symptoms in patients.

Method used

A human eye image segmentation model was constructed. The model was trained using labeled human eye training images. The model parameters were adjusted until convergence was achieved, which improved the segmentation accuracy of the cornea and tear river region. The height of the tear river was then measured using the converged model.

Benefits of technology

It improves the accuracy of tear meniscus height measurement, enabling a more accurate assessment of the progression of dry eye symptoms in patients.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116758375B_ABST
    Figure CN116758375B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a kind of human eye image segmentation model construction method, tear river height measurement method, device, computer storage medium and terminal, and terminal is trained based on marked human eye training image, can reflect the accuracy of the training sample of human eye image segmentation model.So based on the loss result obtained by the first target corneal region and the first target tear river region and the standard corneal region and the standard tear river region, the parameters in the human eye image segmentation model are adjusted by the loss result until the human eye image segmentation model converges, which can improve the adaptability of the human eye image segmentation model to the human eye training image, and improve the accuracy of the corneal region and the tear river region segmentation in the human eye training image by the human eye image segmentation model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of medical imaging technology, and in particular to a method for constructing a human eye image segmentation model, a method for measuring tear river height, a device, a computer storage medium, and a terminal. Background Technology

[0002] The tear river height refers to the height of the plane formed between the upper and lower eyelids and the cornea, reflecting the amount of lacrimal secretion. Tear river height is closely correlated with the ocular surface disease assessment index, tear film breakup time, and tear secretion tests, making it a reliable indicator for assessing dry eye symptoms. A lower tear river height indicates weaker tear secretion and more severe dry eye symptoms. However, the accuracy of tear river height measurements in related technologies is relatively low, and it cannot be used to accurately determine the progression of dry eye symptoms. Summary of the Invention

[0003] This application provides a method for constructing a human eye image segmentation model, a method for measuring tear helix height, a device, a computer storage medium, and a terminal, which can improve the accuracy of tear helix height measurement and thus enable a more accurate determination of the development of a patient's dry eye symptoms using tear helix height.

[0004] In a first aspect, embodiments of this application provide a method for constructing a human eye image segmentation model, the method comprising:

[0005] The labeled human eye training image is input into the human eye image segmentation model to obtain the target human eye segmentation result image corresponding to the human eye training image, wherein the human eye training image is labeled to obtain the standard corneal region and the standard tear river region.

[0006] The loss result of the human eye image segmentation model is obtained based on the first target corneal region and the first target tear river region in the target human eye segmentation result image and the standard corneal region and the standard tear river region in the human eye training image;

[0007] Based on the loss result, adjust the parameters in the human eye image segmentation model and continue training the human eye image segmentation model until the human eye image segmentation model converges.

[0008] In some embodiments, obtaining the loss result of the human eye image segmentation model based on the first target corneal region and the first target tear river region in the target human eye segmentation result image and the standard corneal region and the standard tear river region in the human eye training image includes:

[0009] The boundary values ​​of the first target corneal region and the boundary values ​​of the standard corneal region are input into the loss function to obtain the first loss result of the human eye image segmentation model;

[0010] The boundary values ​​of the first target tear river region and the boundary values ​​of the standard tear river region are input into the loss function to obtain the second loss result of the human eye image segmentation model;

[0011] The adjustment of parameters in the human eye image segmentation model based on the loss result includes:

[0012] Based on the first loss result and the second loss result, the parameters in the human eye image segmentation model are adjusted.

[0013] In some embodiments, the loss function is: H(p,q)=-∑ x (p(x)logq(x));

[0014] Wherein, H(p,q) is the loss result of the human eye image segmentation model; x is the boundary value, when p(x) is the boundary value of the standard corneal region, q(x) is the boundary value of the first target corneal region; when p(x) is the boundary value of the standard tear river region, q(x) is the boundary value of the first target tear river region.

[0015] In some embodiments, before inputting the labeled human eye training image into the human eye image segmentation model to obtain the target human eye segmentation result image corresponding to the human eye training image, the human eye image segmentation model construction method further includes:

[0016] The training images for human eyes are preprocessed to ensure that the aspect ratio and contrast of each training image for human eyes are the same.

[0017] In some embodiments, the preprocessing of the human eye training images includes:

[0018] The size and angle of the human eye training images are adjusted to ensure that the aspect ratio of each human eye training image is the same; and

[0019] The human eye training images are subjected to contrast enhancement processing to ensure that the contrast of each human eye training image is the same.

[0020] Secondly, embodiments of this application provide a method for measuring the height of a tear river, the method comprising:

[0021] The human eye image to be measured is input into the human eye image segmentation model to obtain the target human eye segmentation result image corresponding to the human eye image to be measured, wherein the target human eye segmentation result image includes a second target corneal region and a second target tear river region;

[0022] The tear river height in the image of the human eye to be measured is determined based on the second target corneal region and the second target tear river region.

[0023] Wherein, the human eye image segmentation model is the converged human eye image segmentation model in any one of the first aspects and embodiments of the first aspect.

[0024] In some embodiments, determining the tear river height in the human eye image to be measured based on the second target corneal region and the second target tear river region includes:

[0025] Based on the second target corneal region, determine the tear river reference height values ​​for multiple target locations in the second target tear river region;

[0026] The average of multiple tear river reference height values ​​is taken as the tear river height in the image of the human eye to be measured.

[0027] In some embodiments, determining the tear river reference height values ​​at multiple target locations within the second target tear river region based on the second target corneal region includes:

[0028] Based on the corneal pixel length corresponding to the second target corneal region and the standard corneal length, the length corresponding to a unit pixel in the target human eye segmentation result image is calculated;

[0029] Determine multiple target locations within the second target tear river region and the corresponding tear river pixel height for each target location;

[0030] The reference height value of the tear river at each target location is obtained by multiplying the height of the tear river pixel at each target location by the length of the unit pixel.

[0031] Thirdly, embodiments of this application provide a human eye image segmentation model construction apparatus, the human eye image segmentation model construction apparatus comprising:

[0032] The first input module is used to input the labeled human eye training image into the human eye image segmentation model to obtain the target human eye segmentation result image corresponding to the human eye training image, wherein the human eye training image is labeled to obtain a standard corneal region and a standard tear river region.

[0033] The loss calculation module is used to obtain the loss result of the human eye image segmentation model based on the first target corneal region and the first target tear river region in the target human eye segmentation result image and the standard corneal region and the standard tear river region in the human eye training image;

[0034] The parameter adjustment module is used to adjust the parameters in the human eye image segmentation model based on the loss result, and continue training the human eye image segmentation model until the human eye image segmentation model converges.

[0035] Fourthly, embodiments of this application provide a device for measuring the height of the Tears River, characterized in that the device comprises:

[0036] The second input module is used to input the human eye image to be measured into the human eye image segmentation model to obtain the target human eye segmentation result image corresponding to the human eye image to be measured, wherein the target human eye segmentation result image includes a second target corneal region and a second target tear river region;

[0037] A height determination module is used to determine the tear river height in the image of the human eye to be measured based on the second target corneal region and the second target tear river region;

[0038] Wherein, the human eye image segmentation model is the converged human eye image segmentation model in any one of the first aspects and embodiments of the first aspect.

[0039] Fifthly, embodiments of this application provide a computer program product containing instructions that, when run on a computer or processor, cause the computer or processor to perform the above-described method steps.

[0040] Sixthly, embodiments of this application provide a computer storage medium storing multiple instructions adapted for loading and execution of the above-described method steps by a processor.

[0041] In a seventh aspect, embodiments of this application provide a terminal, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the above-described method steps.

[0042] The beneficial effects of the technical solutions provided in this application include at least the following:

[0043] In one or more embodiments of this application, the terminal inputs an annotated human eye training image into a human eye image segmentation model to obtain a target human eye segmentation result image corresponding to the human eye training image; based on the first target corneal region and the first target tear river region in the target human eye segmentation result image and the standard corneal region and the standard tear river region in the human eye training image, the loss result of the human eye image segmentation model is obtained; based on the loss result, the parameters in the human eye image segmentation model are adjusted, and the human eye image segmentation model is trained until it converges. Since the terminal trains based on the annotated human eye training image, it can reflect the accuracy of the training samples of the human eye image segmentation model. Therefore, by obtaining the loss result based on the first target corneal region and the first target tear river region and the standard corneal region and the standard tear river region, and adjusting the parameters in the human eye image segmentation model based on the loss result until the human eye image segmentation model converges, the adaptability of the human eye image segmentation model to the human eye training image can be improved, and the accuracy of the human eye image segmentation model in segmenting the corneal region and tear river region in the human eye training image can be enhanced. Attached Figure Description

[0044] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0045] Figure 1 An exemplary system architecture diagram of a method for constructing a human eye image segmentation model provided in this application embodiment;

[0046] Figure 2 A flowchart illustrating a method for constructing a human eye image segmentation model, provided in an embodiment of this application;

[0047] Figure 3 This is another flowchart illustrating a method for constructing a human eye image segmentation model provided in an embodiment of this application;

[0048] Figure 4 A schematic diagram of a loss result provided for an embodiment of this application;

[0049] Figure 5 This is another flowchart illustrating a method for constructing a human eye image segmentation model, provided in an embodiment of this application.

[0050] Figure 6 A flowchart illustrating a method for measuring the height of a tear river, provided in an embodiment of this application;

[0051] Figure 7A flowchart illustrating a method for measuring the height of a tear river, provided in an embodiment of this application;

[0052] Figure 8 This is a schematic diagram of the structure of a grayscale image provided in an embodiment of this application;

[0053] Figure 9 This is a schematic diagram illustrating the effect of affine transformation processing on a grayscale image, as provided in an embodiment of this application.

[0054] Figure 10 This is a schematic diagram illustrating the accuracy of a human eye image segmentation model provided in an embodiment of this application.

[0055] Figure 11 A flowchart illustrating a tear river height measurement system provided in this application embodiment;

[0056] Figure 12 A structural block diagram of a human eye image segmentation model construction device provided in this application embodiment;

[0057] Figure 13 A structural block diagram of a tear river height measuring device provided in an embodiment of this application;

[0058] Figure 14 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application. Detailed Implementation

[0059] To make the features and advantages of the embodiments of this application more apparent and understandable, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of the embodiments of this application.

[0060] In the following description, when referring to the accompanying drawings, the same numbers in different drawings denote the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.

[0061] The tear river height refers to the height of the plane formed between the upper and lower eyelids and the cornea, reflecting the amount of lacrimal secretion. The tear river height is closely correlated with the ocular surface disease assessment index, tear film breakup time, and tear secretion test, making it a reliable indicator for assessing dry eye symptoms. A lower tear river height indicates weaker tear secretion and more severe dry eye symptoms.

[0062] In related technologies, tear secretion tests are commonly used to measure the amount of lacrimal gland secretion; the less lacrimal gland secretion, the more severe the patient's dry eye symptoms. Tear hemline height can also be measured using a slit-lamp microscope or an ocular surface analyzer. However, existing tear hemline height measurement methods are easily affected by factors such as shooting angle, light source, and blinking, resulting in low accuracy and making it impossible to accurately determine the progression of a patient's dry eye symptoms.

[0063] Therefore, this application provides a method for constructing a human eye image segmentation model. The method includes inputting an annotated human eye training image into a human eye image segmentation model to obtain a target human eye segmentation result image corresponding to the human eye training image. The human eye training image is annotated to obtain a standard corneal region and a standard tear river region. Based on the first target corneal region and the first target tear river region in the target human eye segmentation result image and the standard corneal region and the standard tear river region in the human eye training image, a loss result of the human eye image segmentation model is obtained. Based on the loss result, the parameters in the human eye image segmentation model are adjusted, and the human eye image segmentation model is continued to be trained until the human eye image segmentation model converges. This solves the problem that the measurement accuracy of the tear river height is low and the tear river height cannot be used to accurately determine the development of dry eye symptoms in patients.

[0064] Please see Figure 1 , Figure 1 This is an exemplary system architecture diagram of a method for constructing a human eye image segmentation model provided in an embodiment of this application.

[0065] like Figure 1 As shown, the system architecture may include a terminal 101, a network 102, and a server 103. The network 102 serves as the medium for providing a communication link between the terminal 101 and the server 103. The network 102 may include various types of wired or wireless communication links, such as: wired communication links including fiber optic cables, twisted-pair cables, or coaxial cables; wireless communication links including Bluetooth communication links, Wireless-Fidelity (Wi-Fi) communication links, or microwave communication links, etc.

[0066] Terminal 101 can interact with server 103 via network 102 to receive messages from or send messages to server 103. Alternatively, terminal 101 can interact with server 103 via network 102 to receive messages or data sent to server 103 by other users. Terminal 101 can be hardware or software. When terminal 101 is hardware, it can be various electronic devices, including but not limited to smartwatches, smartphones, tablets, laptops, and desktop computers. When terminal 101 is software, it can be installed in the aforementioned electronic devices and can be implemented as multiple software programs or software modules (e.g., to provide distributed services) or as a single software program or software module. This application embodiment does not specifically limit this.

[0067] In this embodiment, firstly, terminal 101 inputs the labeled human eye training image into the human eye image segmentation model to obtain a target human eye segmentation result image corresponding to the human eye training image. The human eye training image is labeled to obtain a standard corneal region and a standard tear river region. Secondly, terminal 101 obtains the loss result of the human eye image segmentation model based on the first target corneal region and the first target tear river region in the target human eye segmentation result image and the standard corneal region and the standard tear river region in the human eye training image. Finally, terminal 101 adjusts the parameters in the human eye image segmentation model based on the loss result and continues to train the human eye image segmentation model until the human eye image segmentation model converges.

[0068] Server 103 can be an integrated server providing various services. It should be noted that server 103 can be hardware or software. When server 103 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When server 103 is software, it can be implemented as multiple software programs or software modules (e.g., used to provide distributed services), or as a single software program or software module; this embodiment does not specifically limit its implementation.

[0069] Alternatively, the above system architecture may not include server 103. In other words, server 103 may be an optional device in the embodiments of this application. That is, the method provided in the embodiments of this application can be applied to a system structure that only includes terminal 101. The embodiments of this application do not make specific limitations on this.

[0070] It should be understood that Figure 1 The number of terminals 101, networks 102, and servers 103 in the diagram is only illustrative. Depending on actual needs, there can be any number of terminals 101, networks 102, and servers 103.

[0071] Please see Figure 2 , Figure 2This is a flowchart illustrating a method for constructing a human eye image segmentation model, as provided in an embodiment of this application. For ease of description, the specific execution process of the method for constructing a human eye image segmentation model is described below with the terminal as the executing entity.

[0072] like Figure 2 As shown, methods for constructing human eye image segmentation models can include at least:

[0073] S202. Input the labeled human eye training image into the human eye image segmentation model to obtain the target human eye segmentation result image corresponding to the human eye training image.

[0074] In one or more embodiments of this application, it is first necessary to annotate the training images of each human eye in the sample library. The annotated training images of the human eyes can yield standard corneal regions and standard tear river regions. It should be noted that the standard corneal region and standard tear river region are the accurate corneal region and tear river region annotated from the training images of the human eyes, respectively.

[0075] The process of annotating human eye training images can be done manually based on prior medical knowledge to ensure the accuracy of the annotation of standard corneal regions and standard tear river regions. In some specific embodiments, other methods may also be used, and this application does not limit this approach.

[0076] The terminal inputs the labeled human eye training images into the human eye image segmentation model. The human eye image segmentation model outputs the target human eye segmentation result image corresponding to the human eye training images. This facilitates determining the subsequent training cycle of the human eye image segmentation model based on its prediction performance on each labeled human eye training image. The number of human eye training images in the sample library can be set according to training needs. Typically, a batch of samples in one training cycle can include 64 labeled human eye training images or 128 labeled human eye training images. This application embodiment does not specifically limit this.

[0077] S204. Based on the first target corneal region and the first target tear river region in the target human eye segmentation result image and the standard corneal region and the standard tear river region in the human eye training image, the loss result of the human eye image segmentation model is obtained.

[0078] Optionally, the deviation values ​​between the first target corneal region and the first target tear river region and the standard corneal region and the standard tear river region are calculated using a loss function, and the deviation values ​​are used as the loss results. Based on the loss results, the fitting results of the current human eye image segmentation model can be determined to verify its current performance. Simultaneously, the loss results can also guide the parameter tuning direction of the current human eye image segmentation model, thereby achieving effective training of the human eye image segmentation model.

[0079] S206. Adjust the parameters in the human eye image segmentation model based on the loss results, and continue training the human eye image segmentation model until the human eye image segmentation model converges.

[0080] Optionally, after completing one training cycle, the parameters in the human eye image segmentation model are adjusted based on the loss results, and the human eye image segmentation model is trained again. The above parameter adjustment process in the human eye image segmentation model is repeated until the human eye image segmentation model converges.

[0081] In one or more embodiments of this application, since the terminal is trained based on labeled human eye training images, it can reflect the accuracy of the training samples of the human eye image segmentation model. Then, based on the loss result obtained from the first target corneal region and the first target tear river region compared with the standard corneal region and the standard tear river region, the parameters in the human eye image segmentation model are adjusted according to the loss result until the human eye image segmentation model converges. This improves the adaptability of the human eye image segmentation model to human eye training images and enhances the accuracy of the human eye image segmentation model in segmenting the corneal region and tear river region in the human eye training images.

[0082] Furthermore, the terminal inputs the image of the human eye to be measured into the human eye image segmentation model to obtain the target human eye segmentation result image corresponding to the image of the human eye to be measured. Since the converged human eye image segmentation model can accurately segment the second target corneal region and the second target tear river region in the image of the human eye to be measured, the tear river height in the image of the human eye to be measured can be measured relatively accurately based on the second target corneal region and the second target tear river region. Thus, the development of the patient's dry eye symptoms can be determined relatively accurately based on the tear river height.

[0083] Please see Figure 3 , Figure 3 This is a flowchart illustrating a method for constructing a human eye image segmentation model, as provided in an embodiment of this application.

[0084] like Figure 3 As shown, the training method for the liveness detection model can include at least:

[0085] S302. Input the labeled human eye training image into the human eye image segmentation model to obtain the target human eye segmentation result image corresponding to the human eye training image.

[0086] For details regarding step S302, please refer to the description in step S202; it will not be repeated here.

[0087] S304. Input the boundary values ​​of the first target corneal region and the standard corneal region into the loss function to obtain the first loss result of the human eye image segmentation model.

[0088] S306. Input the boundary values ​​of the first target tear river region and the standard tear river region into the loss function to obtain the second loss result of the human eye image segmentation model.

[0089] The processor uses a loss function to calculate the deviations between the first target corneal region and the first target tear river region and the standard corneal region and the standard tear river region, respectively. The loss function can be the cross-entropy loss function.

[0090] H(p,q)=-∑ x (p(x)logq(x));

[0091] Here, H(p,q) is the cross entropy. The cross entropy H(p,q) measures the degree of difference between two different probability distributions p(x) and q(x) in the same random variable x.

[0092] It's important to note that in neural networks (machine learning), cross-entropy H(p,q) serves as the loss function, where p(x) represents the true probability distribution and q(x) represents the predicted probability distribution. Cross-entropy H(p,q) represents the difference between the true probability distribution p(x) and the predicted probability distribution q(x). The smaller the value of cross-entropy H(p,q), the more accurate the model's predictions.

[0093] In this application, the cross-entropy H(p,q) is the loss result of the human eye image segmentation model, and x is the boundary value. When p(x) is the boundary value of the standard corneal region, q(x) is the boundary value of the first target corneal region; when p(x) is the boundary value of the standard tear river region, q(x) is the boundary value of the first target tear river region.

[0094] The boundary values ​​of the first target corneal region and the standard corneal region are simultaneously input into the human eye image segmentation model to obtain the corresponding first cross-entropy H(p,q). Based on the first cross-entropy H(p,q), the degree of difference between the boundary values ​​of the first target corneal region and the standard corneal region is determined, and the first cross-entropy H(p,q) is used as the first loss result of the human eye image segmentation model. The smaller the value of the first cross-entropy H(p,q), the more accurate the prediction result of the human eye image segmentation model. In other words, the closer the boundary values ​​of the first target corneal region and the standard corneal region are, the higher the overlap between the first target corneal region and the standard corneal region.

[0095] The boundary values ​​of the first target tear river region and the standard tear river region are simultaneously input into the human eye image segmentation model to obtain the corresponding second cross-entropy H(p,q). Based on the second cross-entropy H(p,q), the degree of difference between the boundary values ​​of the first target tear river region and the standard tear river region is determined, and the second cross-entropy H(p,q) is used as the second loss result of the human eye image segmentation model. The smaller the value of the second cross-entropy H(p,q), the more accurate the prediction result of the human eye image segmentation model. In other words, the closer the boundary values ​​of the first target tear river region are to the boundary values ​​of the standard tear river region, the higher the overlap between the first target tear river region and the standard tear river region.

[0096] S308. Based on the first loss result and the second loss result, adjust the parameters in the human eye image segmentation model.

[0097] Optionally, the corresponding parameters in the human eye image segmentation model are adjusted based on the first loss result and the second loss result, and the human eye image segmentation model is trained until the human eye image segmentation model converges.

[0098] Please see Figure 4 , Figure 4 This is a schematic diagram of a loss result provided for an embodiment of this application.

[0099] like Figure 4 As shown, the human eye image segmentation model is trained based on the loss results (first loss result and second loss result). As the number of training iterations increases, the loss result gradually decreases until the human eye image segmentation model converges. Specifically, in this embodiment, the human eye image segmentation model converges when the number of training iterations approaches 160,000.

[0100] In some embodiments, the number of training iterations can be adjusted based on the loss results until the human eye image segmentation model converges.

[0101] In one or more embodiments of this application, since the terminal is trained based on labeled human eye training images, it can reflect the accuracy of the training samples of the human eye image segmentation model. Then, based on the loss result obtained from the first target corneal region and the first target tear river region compared with the standard corneal region and the standard tear river region, the parameters in the human eye image segmentation model are adjusted according to the loss result until the human eye image segmentation model converges. This improves the adaptability of the human eye image segmentation model to human eye training images and enhances the accuracy of the human eye image segmentation model in segmenting the corneal region and tear river region in the human eye training images.

[0102] Please see Figure 5 , Figure 5 This is a flowchart illustrating a method for constructing a human eye image segmentation model, as provided in an embodiment of this application.

[0103] like Figure 5 As shown, methods for constructing human eye image segmentation models can include at least:

[0104] S502. Preprocess the human eye training images to ensure that the aspect ratio and contrast of each human eye training image are the same.

[0105] Optionally, the processor preprocesses the human eye training images, specifically by converting the color images to grayscale to obtain grayscale images. It should be noted that each pixel in a color image is composed of the three primary colors R (Red), G (Green), and B (Blue) mixed in specific proportions. A grayscale image uses unsaturated black to represent each pixel, and the unsaturated black in a grayscale image reflects the intensity of light to some extent.

[0106] According to the formula: Y = 0.299·R + 0.587·G + 0.114·B, a color image can be converted into a grayscale image. Specifically, the terminal sequentially reads the R, G, and B values ​​of each pixel in the color image, inputs the R, G, and B values ​​into the above formula, calculates the grayscale value Y corresponding to each pixel, and assigns the grayscale value Y to the corresponding position of each pixel in the new image. After traversing all pixels, a grayscale image is obtained.

[0107] Color images require analysis and calculation from three perspectives: R value, G value, and B value. Grayscale images, on the other hand, only require analysis and calculation from the perspective of grayscale value Y. Therefore, grayscale images can reduce image dimensionality and memory usage. To a certain extent, this can reduce the computational load of human eye image segmentation models and improve the recognition speed of human eye image segmentation models for corneal and tear river regions in human eye training images.

[0108] In some embodiments, if the memory footprint of the grayscale training image is still large, the grayscale training image can be binarized to further reduce the image dimension and reduce the memory footprint of the training image.

[0109] Meanwhile, grayscale images can increase the contrast of each pixel in the image, and thus, by utilizing the difference in contrast at each pixel location, the corneal region and the tear river region can be segmented more accurately. Because the contrast of the corneal region and the tear river region differs from other locations in a grayscale image, the accuracy and efficiency of human eye image segmentation models in recognizing the corneal region and the tear river region can be improved.

[0110] In this embodiment, the processor can also perform color space conversion processing on the human eye training image. Specifically, the processor performs gradient calculation on the grayscale image, where the gradient is also the edge. The processor can obtain the gradient information (edge ​​information) of the grayscale image by calculating the gradient. Furthermore, the processor can capture the edge position of the grayscale image based on the edge information of the grayscale image, thereby improving the accuracy of the terminal in capturing the edge position of the grayscale image.

[0111] Furthermore, the processor can process grayscale images by capturing their edge positions using affine transformation techniques. Specifically, the processor uses affine transformations to translate, rotate, and scale the grayscale images to adjust their size and angle, ensuring that each grayscale image has the same aspect ratio. This simplifies the recognition steps of the human eye image segmentation model on the training images, facilitates the recognition of corneal and tear duct regions in grayscale images, and improves recognition speed.

[0112] In this embodiment, the processor can also use an image downscaling algorithm with equal-interval sampling to process the grayscale image. Image downscaling is achieved by reducing the number of pixels. Specifically, appropriate pixels are selected from the original grayscale image and removed according to the size that needs to be reduced, while ensuring that the downscaled grayscale image retains the characteristics of the original grayscale image. By reducing the number of pixels, the computational load of the human eye image segmentation model is reduced. At the same time, since the downscaled grayscale image retains the characteristics of the original grayscale image, it can be ensured that the human eye image segmentation model can accurately identify the corneal region and the tear river region, thereby improving the accuracy of the human eye image segmentation model in segmenting the corneal region and the tear river region.

[0113] The processor can use an equal-interval sampling method to select pixels in the original grayscale image at regular intervals for removal. Specifically, let the size of the original grayscale image be W*H, and the width and length reduction factors be k1 and k2, respectively. Then, the sampling intervals of pixels in the width and length directions of the original grayscale image are W / k1 and W / k2, respectively. That is, one pixel is selected every W / k1 in the horizontal direction (width direction) and every W / k2 in the vertical direction (length direction) of the original grayscale image. When the width reduction factor k1 is equal to the length reduction factor k2, the original grayscale image is reduced proportionally; when the width reduction factor k1 and the length reduction factor k2 are not equal, the width and length of the original grayscale image are reduced unequally.

[0114] In this embodiment, the terminal can use an image downscaling algorithm with equal interval sampling to scale the original grayscale image to a 520-pixel * 520-pixel grayscale image; so that the aspect ratio of each grayscale image is the same, thereby simplifying the recognition steps of the human eye image segmentation model on the human eye training image, making it easier for the human eye image segmentation model to recognize the human eye training image and improving the recognition speed.

[0115] In some embodiments, other techniques may be used to adjust the size and angle of the human eye training image, or the grayscale image may be scaled to other sizes. This application does not specifically limit these aspects.

[0116] Furthermore, the processor performs mean subtraction and variance reduction processing on the human eye training images. Specifically, this includes subtracting the mean from the grayscale image to remove variance.

[0117] Specifically, the average value is the average brightness of all pixels in a grayscale image. Subtracting the average value from the grayscale image highlights the different brightness variations in different locations within the image, allowing the grayscale image to emphasize the differences between the corneal region and the tear river region and other locations. Human eye image segmentation models can accurately segment the corneal region and the tear river region based on these differences in the grayscale image compared to other locations.

[0118] Regions with large and small gray values ​​in a grayscale image can negatively impact the extraction of the corneal and tear river regions by the human eye image segmentation model, thus affecting the accuracy of segmentation. To mitigate this impact, dividing the grayscale image by its variance limits the grayscale value of each pixel to a specific range (e.g., between -1 and 1). This reduces the influence of large and small gray values ​​on the target feature extraction by the human eye image segmentation model, thereby improving the accuracy of segmenting the corneal and tear river regions in the training image.

[0119] In some embodiments, the processor may also use gamma transform to process grayscale images, specifically including the processor using gamma transform to adjust the contrast of overexposed or underexposed (too dark) grayscale images.

[0120] Specifically, gamma transform is a nonlinear transformation that enhances the grayscale values ​​of darker areas in a grayscale image and reduces the grayscale values ​​of areas with excessively high grayscale values. A grayscale image processed with gamma transform can enhance overall detail, highlighting the corneal and tear river regions. It can also, to some extent, improve the accuracy of human eye image segmentation models in identifying the corneal and tear river regions in grayscale images.

[0121] In some embodiments, the processor can also smooth the grayscale image. Smoothing can remove small details from the grayscale image or connect small discontinuities in the grayscale image to form larger target features (corneal region and tear river region). This facilitates the extraction of larger target features (corneal region and tear river region in human eye training image) from the grayscale image by the human eye image segmentation model. Simultaneously, smoothing can reduce interference and eliminate random noise in the grayscale image, thus improving the quality of the grayscale image. This, in turn, improves the accuracy and speed of the human eye image segmentation model in recognizing the corneal region and tear river region in the human eye training image.

[0122] In some embodiments, the human eye training images may also undergo other technical processing to highlight the corneal region and tear river region in the human eye training images, thereby improving the accuracy and speed of the human eye image segmentation model in recognizing the corneal region and tear river region.

[0123] S504. Input the labeled human eye training image into the human eye image segmentation model to obtain the target human eye segmentation result image corresponding to the human eye training image.

[0124] S506. Based on the first target corneal region and the first target tear river region in the target human eye segmentation result image and the standard corneal region and the standard tear river region in the human eye training image, the loss result of the human eye image segmentation model is obtained.

[0125] S508. Adjust the parameters in the human eye image segmentation model based on the loss results, and continue training the human eye image segmentation model until the human eye image segmentation model converges.

[0126] For steps S504 to S508, please refer to steps S202 to S206, which will not be repeated here.

[0127] In one or more embodiments of this application, the terminal obtains a grayscale image by performing grayscale processing on the human eye training image, and performs affine transformation processing, mean subtraction and variance division processing, gamma transformation and smoothing processing on the grayscale image to highlight the corneal region and tear river region in the human eye training image, so that the human eye image segmentation model can segment the corneal region and tear river region more accurately.

[0128] Please see Figure 6 , Figure 6 This is a flowchart illustrating a method for measuring the height of a tear river, as provided in an embodiment of this application.

[0129] like Figure 6 As shown, the method for measuring the height of the Tears River can include at least:

[0130] S602. Input the human eye image to be measured into the human eye image segmentation model to obtain the target human eye segmentation result image corresponding to the human eye image to be measured.

[0131] Optionally, in practical application scenarios, the target eye segmentation result image includes a second target corneal region and a second target tear river region. To automatically acquire the second target corneal region and the second target tear river region from the image of the eye to be measured, an eye image segmentation model needs to be deployed. At this time, the eye image segmentation model can acquire the image of the eye to be measured in the current scene based on its own deployment task. The pre-processed image of the eye to be measured is then input into the eye image segmentation model, facilitating its detection and analysis. This allows the model to subsequently respond to user needs based on the segmentation results of the second target corneal region and the second target tear river region output by the eye image segmentation model. The eye image segmentation model used is the eye image segmentation model from any embodiment of this specification.

[0132] Optionally, when acquiring the image of the human eye to be measured in the current scene, the built-in camera in the device or an external camera connected to the device can be used to capture the image of the human eye in the current scene in real time. After acquiring the image of the human eye to be measured, the image of the human eye to be measured is input into the human eye image segmentation model. The human eye image segmentation model can detect the human eye image to be measured and determine the second target tear river region and the segmentation result of the second target tear river region in the human eye image to be measured.

[0133] S604. Determine the tear river height in the image of the human eye to be measured based on the second target corneal region and the second target tear river region.

[0134] Optionally, the human eye image segmentation model is the converged human eye image segmentation model in any of the above embodiments. After the processor inputs the human eye image to be measured into the human eye image segmentation model, the human eye image segmentation model, based on the knowledge of segmenting the corneal region and tear river region learned during training, performs detection and analysis on the human eye image to be measured to obtain output data. The output data can be the second target corneal region and the second target tear river region obtained by segmenting the human eye image to be measured. Based on the second target corneal region and the second target tear river region, the tear river height in the human eye image to be measured can be determined.

[0135] In one or more embodiments of this application, the terminal inputs the human eye image to be measured into the human eye image segmentation model to obtain the target human eye segmentation result image corresponding to the human eye image to be measured. Since the converged human eye image segmentation model can accurately segment the second target corneal region and the second target tear river region in the human eye image to be measured, the tear river height in the human eye image to be measured can be measured relatively accurately based on the second target corneal region and the second target tear river region, and then the development of the patient's dry eye symptoms can be determined relatively accurately based on the tear river height.

[0136] Please see Figure 7 , Figure 7 This is a flowchart illustrating a method for measuring the height of a tear river, as provided in an embodiment of this application.

[0137] like Figure 7 As shown, the method for measuring the height of the Tears River can include at least:

[0138] S702. Input the human eye image to be measured into the human eye image segmentation model to obtain the target human eye segmentation result image corresponding to the human eye image to be measured.

[0139] For details regarding step S702, please refer to the description in step S602; it will not be repeated here.

[0140] S704. Based on the second target corneal region, determine the tear river reference height values ​​for multiple target locations in the second target tear river region.

[0141] Optionally, the processor determines multiple target locations in the second target tear river region and the corresponding tear river pixel height for each target location.

[0142] Please see Figure 8 , Figure 8 This is a schematic diagram of the structure of a grayscale image provided in an embodiment of this application.

[0143] like Figure 8 As shown, firstly, the processor calculates the length of each pixel in the target human eye segmentation result image based on the corneal pixel length corresponding to the second target corneal region and the standard corneal length.

[0144] like Figure 8 As shown, the processor identifies the straight line containing the maximum horizontal diameter of the second target corneal region and places the maximum horizontal diameter in a horizontal position. Simultaneously, this horizontal position of the maximum horizontal diameter is recorded as the upright position of the grayscale image. It should be noted that when the processor adjusts the angle of the grayscale image using affine transformation technology, it can use the maximum horizontal diameter as a reference to place the grayscale image in an upright position.

[0145] Please see Figure 9 , Figure 9 This is a schematic diagram illustrating the effect of affine transformation processing on a grayscale image, as provided in an embodiment of this application.

[0146] like Figure 9 As shown, the top row shows the image of the human eye to be measured before affine transformation processing, and the bottom row shows the image of the human eye to be measured after affine transformation processing. According to... Figure 9 As shown, after adjusting the angle of the grayscale image using affine transformation, the grayscale image is placed in an upright position. An upright grayscale image facilitates the measurement of corneal pixel length and tear meniscus pixel height, which can improve the accuracy of tear meniscus height measurement to some extent.

[0147] It should be noted that, as Figure 8 As shown, the maximum horizontal diameter AB is the line segment with the greatest distance between the two endpoints of the cornea in the second target corneal region. Let the maximum horizontal diameter AB be denoted as the corneal pixel length *a*. Based on the physiological characteristics of the cornea, the average standard corneal length (maximum horizontal diameter) for Chinese adults is 11 mm. Therefore, the length *l* corresponding to each pixel in the segmented image of the target human eye is:

[0148]

[0149] In other words, the ratio of the length corresponding to the maximum horizontal diameter to the pixel corresponding to the maximum horizontal diameter is used as a reference value to facilitate the conversion between the length of the maximum horizontal diameter and the pixel of the maximum horizontal diameter.

[0150] Secondly, determine the locations of multiple targets within the second target tear river region and the corresponding tear river pixel height for each target location. For example... Figure 8 As shown, place the grayscale image in the upright position illustrated. Determine the center point O of the maximum transverse diameter of the second corneal region in the grayscale image. At the designated location, a preset straight line extends along the vertical direction S and passes through the center point O of the maximum horizontal diameter. The position where the preset straight line intersects the second target tear river region along the vertical direction S as shown in the figure is recorded as the preset target position. The distance between the two points where the preset straight line intersects the second target tear river region is recorded as the preset tear river pixel height b′. The first straight line and the second straight line are symmetrical about the preset straight line. The position where the first straight line intersects the second target tear river region along the vertical direction S as shown in the figure is recorded as the first target position. The distance between the two points where the first straight line intersects the second target tear river region is recorded as the first tear river pixel height c′. The position where the second straight line intersects the second target tear river region along the vertical direction S as shown in the figure is recorded as the second target position. The distance between the two points where the second straight line intersects the second target tear river region is recorded as the second tear river pixel height d′.

[0151] Finally, the processor calculates the product of the tear river pixel height corresponding to each target location and the length l corresponding to the unit pixel, to obtain the tear river reference height value for each target location. Specifically, given the preset tear river reference height value b corresponding to the preset target location, the first tear river reference height value c corresponding to the first target location, and the second tear river reference height value d corresponding to the second target location, we have:

[0152]

[0153] S706. The average value of multiple tear river reference heights is taken as the tear river height in the image of the human eye to be measured.

[0154] Optionally, when a preset target position, a first target position, and a second target position are selected in the grayscale image, the tear river height h in the image of the human eye to be measured is:

[0155]

[0156] It should be noted that in some embodiments, the first straight line and the second straight line are set in groups, and multiple groups can be set; each group of the first straight line can find a corresponding second straight line, and the specific number of groups of the first straight line and the second straight line is not limited.

[0157] The terminal can obtain multiple sets of tear river reference height values ​​by setting multiple sets of first and second straight lines. The tear river height is obtained by calculating the average of multiple sets of tear river reference height values. The use of multiple sets of tear river reference height values ​​can improve the calculation accuracy of tear river height, making the tear river height closer to the actual tear river height value, thereby improving the accuracy of judging the development of dry eye symptoms in patients.

[0158] Please see Figure 10 , Figure 10 This is a schematic diagram illustrating the accuracy of a human eye image segmentation model provided in an embodiment of this application.

[0159] like Figure 10 As shown, aAcc, mAcc, and mloU are the accuracy metrics for human eye image segmentation models. aAcc (Average Accuracy) is used to evaluate the overall pixel classification accuracy of the human eye image segmentation model, mAcc (Mean Accuracy) is used to evaluate the overall performance of the human eye image segmentation model in pixel classification, and mloU (Mean Intersection over Union) is used to evaluate the performance differences of the human eye image segmentation model between different pixel categories.

[0160] In one or more embodiments of this application, as the number of training iterations of the human eye image segmentation model increases to 160,000, until the human eye image segmentation model converges, the value of aAcc approaches 100%, indicating that the overall pixel classification accuracy of the human eye image segmentation model is close to 100%. A value of mAcc greater than 90% indicates that the human eye image segmentation model has high overall performance in pixel classification, and a value of mloU close to 90% indicates that the performance difference of the human eye image segmentation model between different pixel categories is large. Through the above analysis, it can be seen that the converged human eye image segmentation model has high classification accuracy and large variability. This ensures the accuracy of corneal pixel length and tear river pixel height measurements, further ensuring the accuracy of tear river height measurements.

[0161] Please see Figure 11 , Figure 11 This is a flowchart illustrating a tear river height measurement system provided in an embodiment of this application.

[0162] like Figure 11As shown, the image of the human eye to be measured is input into the human eye image segmentation model to obtain the target human eye segmentation result image corresponding to the image of the human eye to be measured. The target human eye segmentation result image includes a second target corneal region and a second target tear river region. Based on the second target corneal region and the second target tear river region, the tear river height is calculated by a calculation module (the calculation module includes the tear river height calculation algorithm in the above embodiment). Further, the value of the tear river height is input into an evaluation module. The evaluation module determines that when the tear river height is less than or equal to a preset height, the tear secretion is less and the tear secretion capacity is weak, and the patient is diagnosed as abnormal, i.e., suffering from dry eye syndrome; that is, the preset height is used as the threshold value for judging dry eye syndrome. The greater the degree to which the tear river height is less than the preset height, the more severe the patient's dry eye syndrome. When the tear river height is greater than the preset height, the patient is diagnosed as normal.

[0163] Specifically, the preset height can be 0.2mm. When the tear meniscus height is less than or equal to 0.2mm, the patient is diagnosed with dry eye syndrome. The greater the tear meniscus height is less than 0.2mm, the more severe the patient's dry eye syndrome. When the tear meniscus height is greater than 0.2mm, the patient's eyes are normal.

[0164] It should be noted that the preset height can be set according to the actual situation, and this application embodiment does not limit it.

[0165] The tear meniscus height measurement system calculates the tear meniscus height, assesses the patient's dry eye condition based on a preset height, and automatically evaluates the patient's tear secretion capacity. The system offers fast and accurate detection and analysis, improving the accuracy and speed of dry eye diagnosis. Furthermore, the non-contact measurement process enhances the safety of tear meniscus height measurement.

[0166] Please see Figure 12 , Figure 12 This is a structural block diagram of a human eye image segmentation model construction device provided in an embodiment of this application.

[0167] like Figure 12 As shown, the human eye image segmentation model construction device 120 includes:

[0168] The first input module 121 is used to input the labeled human eye training image into the human eye image segmentation model to obtain the target human eye segmentation result image corresponding to the human eye training image, wherein the human eye training image is labeled to obtain a standard corneal region and a standard tear river region.

[0169] The loss calculation module 122 is used to obtain the loss result of the human eye image segmentation model based on the first target corneal region and the first target tear river region in the target human eye segmentation result image and the standard corneal region and the standard tear river region in the human eye training image;

[0170] The parameter adjustment module 123 is used to adjust the parameters in the human eye image segmentation model based on the loss result, and continue to train the human eye image segmentation model until the human eye image segmentation model converges.

[0171] In some embodiments, the loss calculation module 122 includes:

[0172] The first loss calculation module is used to input the boundary values ​​of the first target corneal region and the boundary values ​​of the standard corneal region into the loss function to obtain the first loss result of the human eye image segmentation model.

[0173] The second loss calculation module is used to input the boundary values ​​of the first target tear river region and the boundary values ​​of the standard tear river region into the loss function to obtain the second loss result of the human eye image segmentation model.

[0174] Parameter adjustment module 123 includes:

[0175] The model adjustment module is used to adjust the parameters in the human eye image segmentation model based on the first loss result and the second loss result.

[0176] In some embodiments, the loss function is: H(p,q)=-∑ x (p(x)logq(x));

[0177] Wherein, H(p,q) is the loss result of the human eye image segmentation model; x is the boundary value, when p(x) is the boundary value of the standard corneal region, q(x) is the boundary value of the first target corneal region; when p(x) is the boundary value of the standard tear river region, q(x) is the boundary value of the first target tear river region.

[0178] In some embodiments, the human eye image segmentation model construction apparatus 120 further includes:

[0179] The preprocessing module is used to preprocess the human eye training images to ensure that the aspect ratio and contrast of each human eye training image are the same.

[0180] In some embodiments, the preprocessing module is specifically used to adjust the size and angle of the human eye training images so that the aspect ratio of each human eye training image is the same; and

[0181] The human eye training images are subjected to contrast enhancement processing to ensure that the contrast of each human eye training image is the same.

[0182] Please see Figure 13 , Figure 13 This is a structural block diagram of a tear river height measuring device provided in an embodiment of this application.

[0183] like Figure 13 As shown, the Tears River height measuring device 130 includes:

[0184] The second input module 131 is used to input the human eye image to be measured into the human eye image segmentation model to obtain the target human eye segmentation result image corresponding to the human eye image to be measured, wherein the target human eye segmentation result image includes a second target corneal region and a second target tear river region;

[0185] Height determination module 132 is used to determine the tear river height in the image of the human eye to be measured based on the second target corneal region and the second target tear river region;

[0186] The human eye image segmentation model is the converged human eye image segmentation model in the above embodiments.

[0187] In some embodiments, the height determination module 132 includes

[0188] The tear river reference height determination module is used to determine the tear river reference height values ​​of multiple target locations in the second target tear river region based on the second target corneal region;

[0189] The tear river height determination module is used to take the average of multiple tear river reference height values ​​as the tear river height in the image of the human eye to be measured.

[0190] In some embodiments, the tear river reference height determination module includes:

[0191] The first height determination module is used to calculate the length of a unit pixel in the target human eye segmentation result image based on the corneal pixel length corresponding to the second target corneal region and the standard corneal length.

[0192] The second height determination module is used to determine multiple target locations in the second target tear river region and the tear river pixel height corresponding to each target location;

[0193] The height calculation module is used to calculate the product of the tear river pixel height and the length corresponding to a unit pixel at each target location, so as to obtain the tear river reference height value at each target location.

[0194] This application provides a computer program product containing instructions that, when run on a computer or processor, cause the computer or processor to perform the steps of any of the methods described in the above embodiments.

[0195] This application also provides a computer storage medium that can store multiple instructions adapted for loading by a processor and executing the steps of any of the methods described in the above embodiments.

[0196] Please see Figure 14 , Figure 14 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application. Figure 14 As shown, terminal 140 may include: at least one terminal processor 141, at least one network interface 144, user interface 143, memory 145, and at least one communication bus 142.

[0197] The communication bus 142 is used to enable communication between these components.

[0198] The user interface 143 may include a display screen and a camera. Optionally, the user interface 143 may also include a standard wired interface and a wireless interface.

[0199] The network interface 144 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).

[0200] The terminal processor 141 may include one or more processing cores. The terminal processor 141 connects to various parts within the terminal 140 using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 145, and by calling data stored in the memory 145. Optionally, the terminal processor 141 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The terminal processor 141 may integrate one or a combination of several of the following: a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), and a modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display on the screen; and the modem handles wireless communication. It is understood that the modem may also be implemented as a separate chip without being integrated into the terminal processor 141.

[0201] The memory 145 may include random access memory (RAM) or read-only memory (ROM). Optionally, the memory 145 may include a non-transitory computer-readable storage medium. The memory 145 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 145 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 145 may also be at least one storage device located remotely from the aforementioned terminal processor 141. Figure 10 As shown, the memory 145, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and application programs.

[0202] exist Figure 10 In the terminal 140 shown, the user interface 143 is mainly used to provide an input interface for the user and to obtain the user's input data; while the terminal processor 141 can be used to call the human eye image segmentation model construction program stored in the memory 145 and specifically perform the following operations:

[0203] The labeled human eye training image is input into the human eye image segmentation model to obtain the target human eye segmentation result image corresponding to the human eye training image, wherein the human eye training image is labeled to obtain the standard corneal region and the standard tear river region.

[0204] The loss result of the human eye image segmentation model is obtained based on the first target corneal region and the first target tear river region in the target human eye segmentation result image and the standard corneal region and the standard tear river region in the human eye training image;

[0205] Based on the loss result, adjust the parameters in the human eye image segmentation model and continue training the human eye image segmentation model until the human eye image segmentation model converges.

[0206] In some embodiments, when the terminal processor 141 executes the loss result of the human eye image segmentation model based on the first target corneal region and the first target tear river region in the target human eye segmentation result image and the standard corneal region and the standard tear river region in the human eye training image, it specifically performs the following steps: inputting the boundary values ​​of the first target corneal region and the boundary values ​​of the standard corneal region into the loss function to obtain the first loss result of the human eye image segmentation model;

[0207] The boundary values ​​of the first target tear river region and the boundary values ​​of the standard tear river region are input into the loss function to obtain the second loss result of the human eye image segmentation model;

[0208] The adjustment of parameters in the human eye image segmentation model based on the loss result includes:

[0209] Based on the first loss result and the second loss result, the parameters in the human eye image segmentation model are adjusted.

[0210] In some embodiments, the loss function is: H(p,q)=-∑ x (p(x)logq(x));

[0211] Wherein, H(p,q) is the loss result of the human eye image segmentation model; x is the boundary value, when p(x) is the boundary value of the standard corneal region, q(x) is the boundary value of the first target corneal region; when p(x) is the boundary value of the standard tear river region, q(x) is the boundary value of the first target tear river region.

[0212] In some embodiments, before the terminal processor 141 executes the step of inputting the labeled human eye training image into the human eye image segmentation model to obtain the target human eye segmentation result image corresponding to the human eye training image, it further performs the following steps: preprocessing the human eye training image so that the aspect ratio and contrast of each human eye training image are the same.

[0213] In some embodiments, when the terminal processor 141 performs the preprocessing of the human eye training images, it specifically performs the following steps: adjusting the size and angle of the human eye training images to ensure that the aspect ratio of each human eye training image is the same; and

[0214] The human eye training images are subjected to contrast enhancement processing to ensure that the contrast of each human eye training image is the same.

[0215] exist Figure 14In the terminal 140 shown, the user interface 143 is mainly used to provide an input interface for the user and to obtain the user's input data; while the terminal processor 141 can also be used to call the application program stored in the memory 145 and specifically perform the following operations:

[0216] The human eye image to be measured is input into the human eye image segmentation model to obtain the target human eye segmentation result image corresponding to the human eye image to be measured, wherein the target human eye segmentation result image includes a second target corneal region and a second target tear river region;

[0217] The tear river height in the image of the human eye to be measured is determined based on the second target corneal region and the second target tear river region.

[0218] Wherein, the human eye image segmentation model is the converged human eye image segmentation model in any of the above embodiments.

[0219] In some embodiments, when the terminal processor 141 performs the step of determining the tear river height in the human eye image to be measured based on the second target corneal region and the second target tear river region, it specifically performs the following steps:

[0220] Based on the second target corneal region, determine the tear river reference height values ​​for multiple target locations in the second target tear river region;

[0221] The average of multiple tear river reference height values ​​is taken as the tear river height in the image of the human eye to be measured.

[0222] In some embodiments, when the terminal processor 141 performs the step of determining the tear river reference height values ​​of multiple target locations in the second target tear river region based on the second target corneal region, it specifically performs the following auxiliary operations:

[0223] Based on the corneal pixel length corresponding to the second target corneal region and the standard corneal length, the length corresponding to a unit pixel in the target human eye segmentation result image is calculated;

[0224] Determine multiple target locations within the second target tear river region and the corresponding tear river pixel height for each target location;

[0225] The reference height value of the tear river at each target location is obtained by multiplying the height of the tear river pixel at each target location by the length of the unit pixel.

[0226] In the several embodiments provided in this specification, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.

[0227] The modules described as separate components may or may not be physically separate. Similarly, the components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0228] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The aforementioned available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital versatile discs (DVDs)), or semiconductor media (e.g., solid-state drives (SSDs)).

[0229] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments of this application.

[0230] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0231] The above is a description of a method for constructing a human eye image segmentation model, a method for measuring the height of the tear river, an apparatus, a computer storage medium, and a terminal provided in the embodiments of this application. For those skilled in the art, based on the ideas of the embodiments of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation on the embodiments of this application.

Claims

1. A method for constructing a human eye image segmentation model, characterized in that, The method for constructing the human eye image segmentation model includes: The labeled human eye training image is input into the human eye image segmentation model to obtain the target human eye segmentation result image corresponding to the human eye training image, wherein the human eye training image is labeled to obtain the standard corneal region and the standard tear river region. The loss result of the human eye image segmentation model is obtained based on the first target corneal region and the first target tear river region in the target human eye segmentation result image and the standard corneal region and the standard tear river region in the human eye training image; Based on the loss result, adjust the parameters in the human eye image segmentation model, and continue training the human eye image segmentation model until the human eye image segmentation model converges; The human eye image to be measured is input into the converged human eye image segmentation model to obtain the target human eye segmentation result image corresponding to the human eye image to be measured, wherein the target human eye segmentation result image includes a second target corneal region and a second target tear river region; Based on the corneal pixel length corresponding to the second target corneal region and the standard corneal length, the length corresponding to a unit pixel in the target human eye segmentation result image is calculated; Multiple target locations within the second target tear river region and corresponding tear river pixel heights for each target location are determined. These multiple target locations include at least a preset target location, a first target location, and a second target location. The preset target location is the intersection of a preset vertical line and the second target tear river region when the image of the human eye to be measured is viewed upright. The preset tear river pixel height corresponding to the preset target location is the distance between the two points where the preset vertical line intersects the second target tear river region. The preset vertical line passes through the center point of the maximum horizontal diameter of the second target corneal region. The first target location is the intersection of a first vertical line and the second target tear river region. The first tear river pixel height corresponding to the first target location is the distance between the two points where the first vertical line intersects the second target tear river region. The second target location is the intersection of a second vertical line and the second target tear river region. The second tear river pixel height corresponding to the second target location is the distance between the two points where the second vertical line intersects the second target tear river region. The first vertical line and the second vertical line are symmetrical about the preset vertical line. Calculate the product of the tear river pixel height and the length corresponding to a unit pixel at each target location to obtain the tear river reference height value at each target location; The average of multiple tear river reference height values ​​is taken as the tear river height in the image of the human eye to be measured.

2. The method for constructing a human eye image segmentation model according to claim 1, characterized in that, The loss result of the human eye image segmentation model obtained based on the first target corneal region and the first target tear river region in the target human eye segmentation result image and the standard corneal region and the standard tear river region in the human eye training image includes: The boundary values ​​of the first target corneal region and the boundary values ​​of the standard corneal region are input into the loss function to obtain the first loss result of the human eye image segmentation model; The boundary values ​​of the first target tear river region and the boundary values ​​of the standard tear river region are input into the loss function to obtain the second loss result of the human eye image segmentation model. The adjustment of parameters in the human eye image segmentation model based on the loss result includes: Based on the first loss result and the second loss result, the parameters in the human eye image segmentation model are adjusted.

3. The method for constructing a human eye image segmentation model according to claim 2, characterized in that, The loss function is: ; Wherein, H(p,q) is the loss result of the human eye image segmentation model; x is the boundary value, when p(x) is the boundary value of the standard corneal region, q(x) is the boundary value of the first target corneal region; when p(x) is the boundary value of the standard tear river region, q(x) is the boundary value of the first target tear river region.

4. The method for constructing a human eye image segmentation model according to claim 1, characterized in that, Before inputting the labeled human eye training image into the human eye image segmentation model to obtain the target human eye segmentation result image corresponding to the human eye training image, the human eye image segmentation model construction method further includes: The training images for human eyes are preprocessed to ensure that the aspect ratio and contrast of each training image for human eyes are the same.

5. The method for constructing a human eye image segmentation model according to claim 4, characterized in that, The preprocessing of the human eye training images includes: The size and angle of the human eye training images are adjusted to ensure that the aspect ratio of each human eye training image is the same; and The human eye training images are subjected to contrast enhancement processing to ensure that the contrast of each human eye training image is the same.

6. A device for constructing a human eye image segmentation model, characterized in that, The human eye image segmentation model construction device includes: The first input module is used to input the labeled human eye training image into the human eye image segmentation model to obtain the target human eye segmentation result image corresponding to the human eye training image, wherein the human eye training image is labeled to obtain a standard corneal region and a standard tear river region. The loss calculation module is used to obtain the loss result of the human eye image segmentation model based on the first target corneal region and the first target tear river region in the target human eye segmentation result image and the standard corneal region and the standard tear river region in the human eye training image; The parameter adjustment module is used to adjust the parameters in the human eye image segmentation model based on the loss result, and continue to train the human eye image segmentation model until the human eye image segmentation model converges. The human eye image to be measured is input into the converged human eye image segmentation model to obtain the target human eye segmentation result image corresponding to the human eye image to be measured, wherein the target human eye segmentation result image includes a second target corneal region and a second target tear river region; Based on the corneal pixel length corresponding to the second target corneal region and the standard corneal length, the length corresponding to a unit pixel in the target human eye segmentation result image is calculated; Multiple target locations within the second target tear river region and corresponding tear river pixel heights for each target location are determined. These multiple target locations include at least a preset target location, a first target location, and a second target location. The preset target location is the intersection of a preset vertical line and the second target tear river region when the image of the human eye to be measured is viewed upright. The preset tear river pixel height corresponding to the preset target location is the distance between the two points where the preset vertical line intersects the second target tear river region. The preset vertical line passes through the center point of the maximum horizontal diameter of the second target corneal region. The first target location is the intersection of a first vertical line and the second target tear river region. The first tear river pixel height corresponding to the first target location is the distance between the two points where the first vertical line intersects the second target tear river region. The second target location is the intersection of a second vertical line and the second target tear river region. The second tear river pixel height corresponding to the second target location is the distance between the two points where the second vertical line intersects the second target tear river region. The first vertical line and the second vertical line are symmetrical about the preset vertical line. Calculate the product of the tear river pixel height and the length corresponding to a unit pixel at each target location to obtain the tear river reference height value at each target location; The average of multiple tear river reference height values ​​is taken as the tear river height in the image of the human eye to be measured.

7. A computer storage medium, characterized in that, The computer storage medium stores multiple instructions adapted for loading by a processor and executing the steps of the method as described in any one of claims 1 to 5.

8. A terminal, characterized in that, The terminal includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the method as described in any one of claims 1 to 5.