Pupil center positioning method and device, equipment and storage medium
Through the EfficientUNet model combined with multiple positioning methods, the existing pupil center positioning method has solved the problem of high computing resource requirements and insufficient anti-interference ability of the existing pupil center positioning method, and achieved efficient and accurate pupil center positioning on embedded devices to adapt to the differences between different individuals.
Patent Information
- Application Number
- CN202510577732.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-15
AI Technical Summary
The existing pupil center positioning method has high complexity, high computing resource requirements, and is difficult to deploy on embedded or mobile devices. It has insufficient anti-interference capabilities and weak individual differences processing capabilities, resulting in insufficient positioning accuracy and robustness.
The EfficientUNet model is used to locate the pupil center, extract multi-scale features through the encoder, and the decoder fuses the output pupil heat map, and combines three methods: pixel value size, pixel probability distribution and center of mass weighting calculation to determine the pupil center coordinates, reduce the model parameters, and enhance anti-interference ability and generalization ability.
It is efficiently deployed on embedded and mobile devices, and can accurately locate the pupil center in complex environments, improve positioning accuracy and robustness, adapt to individual differences among different groups of people, and meet real-time application needs.
Smart Images

Figure CN120495410A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of image processing, and in particular to a pupil center positioning method, apparatus, device and storage medium. Background Art
[0002] Currently, in the field of pupil center positioning, semantic segmentation methods based on the U-Net structure are more commonly used. For example, Hsiao et al. (Cheng-Shun Hsiao, Chih-Peng Fan, Chung Hsing University) proposed a pupil positioning and iris recognition method based on the combination of EfficientNet and U-Net. Their technical route is: first use U-Net to achieve semantic segmentation of the pupil area, then use the obtained pupil area to extract iris features, and finally use EfficientNet for classification and recognition. This method achieved high accuracy on the CASIA-v3 dataset (recognition accuracy reached 98.2%, EER close to 0%).
[0003] However, this method still has some shortcomings in practical application scenarios:
[0004] (1) High model complexity: The traditional U-Net model has a large number of parameters and high demand for computing resources, making it difficult to deploy on embedded or mobile devices, which restricts the possibility of real-time applications.
[0005] (2) Insufficient anti-interference ability: In actual scenes, complex lighting, noise interference, pupil occlusion and other problems are common. Traditional U-Net is sensitive to these interference factors, especially when the lighting changes drastically or the occlusion is severe, the accuracy of pupil positioning is significantly reduced.
[0006] (3) Weak ability to process individual differences: There are obvious differences in pupil shape, size, and grayscale distribution among different groups of people. Traditional semantic segmentation models have poor generalization performance when facing cross-individual differences, and the robustness and accuracy of the model cannot be guaranteed. Summary of the Invention
[0007] The embodiments of the present application provide a pupil center positioning method, device, and storage medium to solve the problem of through-hole positioning accuracy.
[0008] In one aspect, the present application provides a method for locating the pupil center, the method comprising:
[0009] Read the original eye image, pre-process it and then feed it into the image segmentation network model. The encoder extracts the scale features and the decoder fuses them to output the pupil heat map.
[0010] After preprocessing the pupil heat map, searching for the first candidate coordinates according to the pixel value, searching for the second candidate coordinates according to the pixel probability distribution, and calculating the third candidate coordinates according to the centroid weighting;
[0011] The three candidate coordinates are weighted averaged to obtain the target pupil center coordinates.
[0012] Specifically, searching for the first candidate coordinate according to the pixel value includes:
[0013] Use the argmax algorithm to traverse all points in the pupil heat map, calculate the pixel value of each point, and determine the pixel coordinates corresponding to the maximum pixel value as the first candidate coordinates of the pupil center, which is expressed as follows:
[0014]
[0015] (x argmax ,y argmax ) represents the first candidate coordinate, argmax represents the calculation function, and H(x,y) represents the pupil heat map.
[0016] Specifically, searching for the second candidate coordinate according to pixel probability distribution includes:
[0017] set up L×W is the image size, and the pupil heat map is flattened into a one-dimensional vector Calculate the softmax probability distribution as follows:
[0018]
[0019] Construct the pixel index coordinates (x i ,y i ), calculate the pupil expected coordinates (x ′ ,y ′ ), the formula is as follows:
[0020]
[0021] The expected pupil coordinates are determined as the second candidate coordinates.
[0022] Specifically, the weighted calculation of the third candidate coordinates according to the centroid includes:
[0023] Normalize the pupil heat map to grayscale and obtain the normalized heat map
[0024] The normalized heat map is used as a two-dimensional density distribution map, and the centroid coordinates (x c ,y c ), the formula is as follows:
[0025]
[0026] The centroid coordinates are determined as the third candidate coordinates.
[0027] Specifically, performing weighted average calculation on the three candidate coordinates to obtain the target pupil center coordinates includes:
[0028] The three candidate coordinates are averaged and the average position is calculated to obtain the target pupil center coordinate (x avg ,y avg ), which is expressed as follows:
[0029]
[0030] Specifically, the encoder of the image segmentation network model includes N cascaded encoding blocks, and the decoder includes N cascaded decoding blocks, and the encoding blocks and the decoding blocks correspond to each other;
[0031] The encoding block extracts features from the original eye image layer by layer, and the decoding block gradually restores the low-resolution semantic features into a pupil heat map output of the same size as the original eye image;
[0032] The decoding block first upsamples the low-resolution feature map through bilinear interpolation or transposed convolution, then splices it with the feature map from the encoding block at the same level, and then performs feature fusion through convolution and activation operations.
[0033] Specifically, the encoding block includes a 1*1 convolution block, a DW convolution block, a SE attention unit block, a 1*1 convolution block, and a Dropout unit block that are cascaded in sequence;
[0034] The input original eye image or feature image passes through the 1*1 convolution block to integrate the number of channels and fuse the features, and then passes through the DW convolution block to efficiently extract the spatial features. Then, the SE attention unit block adaptively adjusts the channel weights to enhance the important features of the eye, and then passes through the 1*1 convolution block to integrate the features. Finally, it passes through the Dropout unit block for regularization processing. After enhancing the generalized output, the output is superimposed and fused through the jump connection established between the input.
[0035] On the other hand, the present application provides a pupil center positioning device, the device comprising:
[0036] The first output module is used to read the original eye image, pre-process it and then feed it into the image segmentation network model. The encoder extracts the scale features and the decoder fuses them to output the pupil heat map;
[0037] a calculation module, configured to pre-process the pupil heat map, search for the first candidate coordinates according to the pixel value, search for the second candidate coordinates according to the pixel probability distribution, and calculate the third candidate coordinates according to the centroid weighting;
[0038] The second output module is used to perform weighted average calculation on the three candidate coordinates to obtain the target pupil center coordinates.
[0039] On the other hand, the present application provides a computer device, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, the at least one program, the code set or instruction set is loaded and executed by the processor to implement the pupil center positioning method described in the above aspect.
[0040] On the other hand, the present application provides a computer-readable storage medium, which stores at least one instruction, at least one program, code set or instruction set. The at least one instruction, the at least one program, the code set or instruction set is loaded and executed by a processor to implement the pupil center positioning method described in the above aspect.
[0041] The beneficial effects of the technical solutions provided in the embodiments of the present application include at least:
[0042] (1) The model is streamlined and efficient: Compared with the traditional U-Net, the EfficientUNet model used in this solution has greatly reduced the number of parameters and significantly reduced computing resource consumption. It can be efficiently deployed on embedded and mobile devices to meet real-time application requirements.
[0043] (2) Strong anti-interference ability: By introducing the thermal map prediction mechanism, this scheme can effectively suppress the influence of factors such as complex lighting conditions, noise interference and partial occlusion, and can still accurately achieve pupil positioning in complex environments, thereby improving the robustness of the system.
[0044] (2) Improved generalization capability: The EfficientUNet model enhances its adaptability to individual pupil morphology differences through more effective feature extraction and expression, significantly improves the positioning accuracy between different populations, and ensures universality in practical applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 is a flowchart of the pupil center positioning method provided in an embodiment of the present application;
[0046] Figure 2 Shows a structural diagram of the image segmentation network model designed based on EfficientUNet;
[0047] Figure 3 The pupil heat map output by the model based on the original eye image;
[0048] Figure 4 It is a schematic diagram of the network structure of the encoding block;
[0049] Figure 5 is a flowchart of the pupil center positioning method provided in an embodiment of the present application;
[0050] Figure 6 This is a comparison of the pupil center positioning effect of the classic algorithms Excuse and Else.
[0051] Figure 7 The following is a structural block diagram of a pupil center positioning device provided by an embodiment of the present application;
[0052] Figure 8 A structural block diagram of a computer device provided by an exemplary embodiment of the present application is shown. DETAILED DESCRIPTION
[0053] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0054] In this document, "plurality" refers to two or more. "And / or" describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. The character " / " generally indicates an "or" relationship between the associated objects.
[0055] Figure 1 : is a flowchart of the pupil center positioning method provided in an embodiment of the present application, comprising the following steps:
[0056] S1. Read the original eye image, pre-process it and then feed it into the image segmentation network model. The encoder extracts the scale features and the decoder fuses them to output the pupil heat map.
[0057] The preprocessing process can involve various operations, such as resizing (e.g., scaling to 256×256), normalizing (dividing pixel values by 255), and converting the image to a Tensor format to meet the input requirements of deep learning models. This solution requires the design of a separate image segmentation network model to process the preprocessed raw eye image and extract the pupil heatmap.
[0058] Image segmentation network models typically include an encoder and a decoder to decode the image. For example, this embodiment uses a model based on EfficientUNet. The model extracts multi-scale features through the encoder, which are then upsampled and fused layer by layer by the decoder. The model ultimately outputs a heatmap that represents the spatial probability distribution of the pupil center in the image.
[0059] Figure 2 The diagram shows the structure of the image segmentation network model designed based on EfficientUNet. The left side of the figure is the encoder part, and the right side is the decoder part. The original eye image Image is sent to the encoder part, and the corresponding heat map is output after encoding and decoding feature extraction. Figure 3 This is the pupil heat map output by the model based on the original eye image.
[0060] The main purpose of heat maps is to accurately regress the target location, such as the pupil center, by generating a continuous probability distribution, rather than simply segmenting a binary region. Although EfficientNet-based models can directly segment the pupil and obtain a binary mask, this segmentation method often only gives an approximate pupil area, which may not be accurate enough.
[0061] Next, the heatmap is analyzed and preprocessed. The heatmap represents the probability that each pixel is the center of the pupil. Visually, it appears as a bright center and dark edges. The heatmap is then post-processed using Gaussian filtering and smoothing to enhance the continuity of the target area, suppress noise interference, and improve the stability and accuracy of the subsequent positioning algorithm.
[0062] S2. After preprocessing the pupil heat map, search for the first candidate coordinates according to the pixel value, search for the second candidate coordinates according to the pixel probability distribution, and calculate the third candidate coordinates according to the centroid weighting;
[0063] The main purpose of heat maps is to accurately regress the target location, such as the pupil center, by generating a continuous probability distribution, rather than simply segmenting a binary region. Although EfficientNet-based models can directly segment the pupil and obtain a binary mask, this segmentation method often only gives an approximate pupil area, which may not be accurate enough.
[0064] This application uses heat maps to determine the pupil center using at least three positioning methods simultaneously, avoiding the inaccuracy that can occur with a single positioning method. These methods include searching by pixel value, searching by pixel probability distribution, and obtaining coordinates using a weighted centroid calculation. These three methods offer successively higher accuracy, each focusing on a different positioning logic.
[0065] S3. Perform weighted average calculation on the three candidate coordinates to obtain the target pupil center coordinates.
[0066] Using heatmap regression has the following advantages:
[0067] 1. Fine positioning: Heatmap regression can retain continuous probability values in the output and use the maximum response or soft argmax method to obtain the sub-pixel pupil center position, which is very important for subsequent iris recognition and feature extraction.
[0068] 2. Robustness: Under lighting, noise, or occlusion conditions, heat maps can express uncertainty more smoothly, while segmented binary images may be more affected by errors.
[0069] 3. Simple post-processing: The peak of the heat map directly corresponds to the target location. Compared with calculating the center of mass or boundary from the segmentation results, it is easier to directly obtain the target center.
[0070] In general, heatmap regression can provide more accurate and robust positioning information rather than just a rough segmentation result. If the task requires precise positioning of the pupil center, heatmap regression often leads to better results.
[0071] In some embodiments, the encoder uses the efficient and lightweight EfficientNet, while the decoder draws on the classic U-Net architecture, integrating contextual information and spatial details to construct an end-to-end heatmap regression model suitable for pupil localization tasks. Experiments were conducted on eye image datasets such as MMU and CASIA, with input images of a uniform size of 256×256 to accommodate the multi-scale feature extraction of the network architecture.
[0072] The image segmentation network model's encoder, based on variants such as EfficientNet-B0 through B3, consists of N cascaded encoding blocks, while the decoder consists of N cascaded decoding blocks, with the encoding and decoding blocks corresponding to each other. The encoding block extracts features from the original eye image layer by layer, while the decoding block gradually restores the low-resolution semantic features into a pupil heatmap output of the same size as the original eye image.
[0073] The core of each encoding block is a Mobile Inverted Bottleneck Convolution (MBConv) module, which combines depthwise separable convolution (DSC), a channel-wise squeeze-and-excitation (SE) attention mechanism, and a residual connection structure. Through global average pooling and adaptive channel weight adjustment, the SE unit block effectively enhances the network's perception of feature areas such as edges, textures, and local details, improving the ability to discriminate pupil boundaries. Furthermore, the residual structure alleviates the vanishing gradient problem in deep network training and improves the stable transfer of features.
[0074] See also Figure 4 As shown in the figure, it specifically consists of a cascade of 1*1 convolution blocks, DW convolution blocks, SE attention units, 1*1 convolution blocks, and Dropout units. The input original eye image or feature image passes through the 1*1 convolution block to round the number of channels and fuse features. The DW convolution block efficiently extracts spatial features. The SE attention unit block then adaptively adjusts channel weights to enhance important eye features. The features are then integrated through the 1*1 convolution block. Finally, the Dropout unit block performs regularization processing to enhance the generalized output. The output is then superimposed and fused through the jump connection established between the input and the output.
[0075] The encoder outputs feature maps at multiple scales, containing contextual information at different receptive fields. These feature maps are fed into the decoder via skip connections and fused with symmetrical upsampling layers, preserving high-resolution spatial information and enabling pixel-by-pixel segmentation of the pupil region. The decoder uses transposed convolution or bilinear interpolation for upsampling, fusing encoder features of the corresponding scale at each layer to ensure segmentation accuracy and boundary integrity.
[0076] The overall model structure boasts advantages such as a small number of parameters, fast inference speed, and strong feature expression capabilities, making it particularly suitable for pupil center localization tasks requiring high precision and real-time performance. Compared to traditional ResNet or VGG encoders, the use of EfficientNet in this solution not only improves the model's computational efficiency but also significantly enhances its adaptability to eye images in complex environments, laying the foundation for the subsequent accurate prediction of pupil heatmaps.
[0077] The decoder of the U-Net network is primarily responsible for gradually restoring the low-resolution semantic features extracted by the encoder into a heatmap output of the same size as the input image. The decoder uses a gradual upsampling method, coupled with a skip connection structure, to fuse high-resolution features from the encoder layer by layer, achieving refined boundary recovery and target region reconstruction.
[0078] Each decoder layer consists of the following structure: low-resolution feature maps are first upsampled through bilinear interpolation or transposed convolution, then concatenated with feature maps from the encoder at the same level. Finally, a series of convolutions (Conv2D) and activation operations (such as ReLU) are performed for fusion and feature refinement. This design fully utilizes the fine-grained edge information provided by the encoder's shallow layers and the abstract semantic information provided by its deeper layers, thereby improving pupil segmentation accuracy.
[0079] In addition, this scheme can use an attention mechanism (such as Attention Gate) to perform weighted control on the channels in the jump connection during the fusion stage, thereby suppressing background interference and improving the response intensity of the target area.
[0080] In one possible implementation, the process of calculating candidate coordinates can be summarized as follows:
[0081] 1. Search for the first candidate coordinates according to the pixel value. Use the argmax algorithm to traverse all points in the pupil heat map, calculate the pixel value of each point, and determine the pixel coordinate corresponding to the maximum pixel value as the first candidate coordinate of the pupil center, which is expressed as follows:
[0082]
[0083] (x argmax ,y argmax ) represents the first candidate coordinate, argmax represents the calculation function, and H(x,y) represents the pupil heat map.
[0084] 2. Search for the second candidate coordinate according to the pixel probability distribution and set L×W is the image size, and the pupil heat map is flattened into a one-dimensional vector Calculate the softmax probability distribution as follows:
[0085]
[0086] Construct the pixel index coordinates (x i ,y i ), calculate the pupil expected coordinates (x ′,y ′ ), the formula is as follows:
[0087]
[0088] The expected pupil coordinates are determined as the second candidate coordinates.
[0089] 3. Calculate the third candidate coordinates according to the weighted centroid, perform grayscale normalization on the pupil heat map, and obtain the normalized heat map Should It is a normalized heat map (e.g., after Gaussian filtering and smoothing), ensuring that the value range is [0, 1] or the sum is 1; this method regards the heat map as a two-dimensional density distribution map and calculates its centroid position by weighting the pixel values.
[0090] The normalized heat map is used as a two-dimensional density distribution map, and the centroid coordinates (x c ,y c ), the formula is as follows:
[0091]
[0092] The centroid coordinates are determined as the third candidate coordinates.
[0093] Figure 5 The process of calculating the target pupil center coordinates is shown in Figure 1. The three candidate coordinates are averaged, and the average position is calculated to obtain the target pupil center coordinates (x avg ,y avg ), which is expressed as follows:
[0094]
[0095] Figure 6 Figure 1 shows the pupil center localization results of the classic algorithms Excuse and Else. As can be seen from Figures (a) and (b), both algorithms experience varying degrees of deviation during pupil center localization. In particular, in scenarios with blurred edges, changing illumination, or pupil deformation, the positioning results are less stable. Figure (c) shows the experimental results of our algorithm, which accurately captures the pupil center under a variety of complex backgrounds. The annotation points are more concentrated and symmetrical, resulting in higher positioning accuracy and robustness. Furthermore, our method demonstrates good generalization across multiple samples, with minimal fluctuation in positioning error and no significant jumps or abnormal drift, verifying the algorithm's stability and practicality in practical applications.
[0096] In summary, the technical effects brought about by the present application solution can be summarized as follows:
[0097] (1) The model is streamlined and efficient: Compared with the traditional U-Net, the EfficientUNet model used in this paper greatly reduces the number of parameters and significantly reduces the consumption of computing resources. It can be efficiently deployed on embedded and mobile devices to meet real-time application requirements.
[0098] (2) Strong anti-interference ability: By introducing the thermal map prediction mechanism, the present invention can effectively suppress the influence of factors such as complex lighting conditions, noise interference and partial occlusion, and can still accurately achieve pupil positioning in complex environments, thereby improving the robustness of the system.
[0099] (3) Improved generalization capability: The EfficientUNet model of the present invention enhances adaptability to inter-individual pupil morphology differences through more effective feature extraction and expression, significantly improves positioning accuracy between different populations, and ensures universality in practical applications.
[0100] Figure 7 The structure block diagram of the pupil center positioning device provided in an embodiment of the present application is shown, and the device includes:
[0101] The first output module 710 is used to read the original eye image, pre-process it and then feed it into the image segmentation network model, extract the scale features through the encoder and fuse them with the decoder to output the pupil heat map;
[0102] A calculation module 720 is configured to pre-process the pupil heat map, search for first candidate coordinates based on pixel values, search for second candidate coordinates based on pixel probability distribution, and calculate third candidate coordinates based on centroid weighting;
[0103] The second output module 730 is used to perform weighted average calculation on the three candidate coordinates to obtain the target pupil center coordinates.
[0104] The pupil center positioning device provided in the embodiment of the present application can be applied to the pupil center positioning method provided in the above embodiment. For relevant details, please refer to the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here.
[0105] It should be noted that the pupil center locating device provided in the embodiments of the present application is only illustrated by the division of the above-mentioned functional modules / functional units. In actual applications, the above-mentioned functions can be assigned to different functional modules / functional units as needed, that is, the internal structure of the pupil center locating device can be divided into different functional modules / functional units to complete all or part of the functions described above. In addition, the implementation method of the pupil center locating method provided in the above-mentioned method embodiment and the implementation method of the pupil center locating device provided in this embodiment are based on the same concept. The specific implementation process of the pupil center locating device provided in this embodiment is detailed in the above-mentioned method embodiment and will not be repeated here.
[0106] Figure 8 The block diagram of the computer device provided by an exemplary embodiment of the present application is shown. It can be a computer device such as a desktop computer, a laptop computer, a PDA, and a cloud server. The computer device may include, but is not limited to, a processor and a memory. The processor and the memory may be connected via a bus or other means. The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, graphics processing units (GPU), embedded neural network processors (NPU) or other dedicated deep learning coprocessors, discrete gate or transistor logic devices, discrete hardware components and other chips, or a combination of the above-mentioned chips.
[0107] The processor may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0108] As a non-transient computer-readable storage medium, the memory can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the methods in the above-mentioned embodiments of the present application. The processor executes various functional applications and data processing of the processor by running the non-transient software programs, instructions and modules stored in the memory, that is, the method in the above-mentioned method embodiment is implemented. The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.
[0109] The peripheral device interface can be used to connect at least one I / O (Input / Output)-related peripheral device to the processor and memory. In some embodiments, the processor, memory, and peripheral device interface are integrated on the same chip or circuit board. In other embodiments, any one or two of the processor, memory, and peripheral device interface can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0110] The embodiment of the present application also discloses a computer-readable storage medium. Specifically, the computer-readable storage medium is used to store a computer program, and when the computer program is executed by the processor, the method in the above-mentioned method implementation is implemented. Those skilled in the art will understand that all or part of the processes in the above-mentioned implementation method of the present application can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, which, when executed, may include the processes of the implementation methods of the above-mentioned methods. Among them, the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk (Hard Disk Drive, abbreviated as: HDD) or a solid-state drive (SSD), etc.; the storage medium may also include a combination of the above-mentioned types of memories.
[0111] This specific embodiment is merely an explanation of the present invention and is not intended to limit the present invention. After reading this specification, those skilled in the art may make non-creative modifications to this embodiment as needed. However, as long as such modifications are within the scope of the claims of the present invention, they are protected by patent law.
Claims
1. A pupil center positioning method, characterized in that: The method comprises: Read the original eye image, pre-process it and then feed it into the image segmentation network model. The encoder extracts the scale features and the decoder fuses them to output the pupil heat map. After preprocessing the pupil heat map, searching for the first candidate coordinates according to the pixel value, searching for the second candidate coordinates according to the pixel probability distribution, and calculating the third candidate coordinates according to the centroid weighting; The three candidate coordinates are weighted averaged to obtain the target pupil center coordinates.
2. The method according to claim 1, characterized in that The step of searching for the first candidate coordinate according to the pixel value includes: Use the argmax algorithm to traverse all points in the pupil heat map, calculate the pixel value of each point, and determine the pixel coordinates corresponding to the maximum pixel value as the first candidate coordinates of the pupil center, which is expressed as follows: (x argmax ,y argmax ) represents the first candidate coordinate, argmax represents the calculation function, and H(x,y) represents the pupil heat map.
3. The method according to claim 2, characterized in that The searching for the second candidate coordinate according to the pixel probability distribution includes: set up L×W is the image size, and the pupil heat map is flattened into a one-dimensional vector Calculate the softmax probability distribution as follows: Construct the pixel index coordinates (x i ,y i ), calculate the pupil expected coordinates (x ′ ,y ′ ), the formula is as follows: The expected pupil coordinates are determined as the second candidate coordinates.
4. The method according to claim 3, characterized in that The calculating the third candidate coordinates according to the weighted centroid method includes: Normalize the pupil heat map to grayscale and obtain the normalized heat map The normalized heat map is used as a two-dimensional density distribution map, and the centroid coordinates (x c ,y c ), the formula is as follows: The centroid coordinates are determined as the third candidate coordinates.
5. The method according to claim 4, characterized in that The weighted average calculation of the three candidate coordinates to obtain the target pupil center coordinates includes: The three candidate coordinates are averaged and the average position is calculated to obtain the target pupil center coordinate (x avg ,y avg ), which is expressed as follows:
6. The method according to claim 1, characterized in that The encoder of the image segmentation network model includes N cascaded encoding blocks, and the decoder includes N cascaded decoding blocks, and the encoding blocks and the decoding blocks correspond to each other; The encoding block extracts features from the original eye image layer by layer, and the decoding block gradually restores the low-resolution semantic features into a pupil heat map output of the same size as the original eye image; The decoding block first upsamples the low-resolution feature map through bilinear interpolation or transposed convolution, then splices it with the feature map from the encoding block at the same level, and then performs feature fusion through convolution and activation operations.
7. The method according to claim 6, characterized in that The encoding block includes a 1*1 convolution block, a DW convolution block, a SE attention unit block, a 1*1 convolution block, and a Dropout unit block that are cascaded in sequence; The input original eye image or feature image passes through the 1*1 convolution block to integrate the number of channels and fuse the features, and then passes through the DW convolution block to efficiently extract the spatial features. Then, the SE attention unit block adaptively adjusts the channel weights to enhance the important features of the eye, and then passes through the 1*1 convolution block to integrate the features. Finally, it passes through the Dropout unit block for regularization processing. After enhancing the generalized output, the output is superimposed and fused through the jump connection established between the input.
8. A pupil center positioning device, characterized in that: The device comprises: The first output module is used to read the original eye image, pre-process it and then feed it into the image segmentation network model. The encoder extracts the scale features and the decoder fuses them to output the pupil heat map; a calculation module, configured to pre-process the pupil heat map, search for the first candidate coordinates according to the pixel value, search for the second candidate coordinates according to the pixel probability distribution, and calculate the third candidate coordinates according to the centroid weighting; The second output module is used to perform weighted average calculation on the three candidate coordinates to obtain the target pupil center coordinates.
9. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the pupil center positioning method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The readable storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the pupil center positioning method as described in any one of claims 1 to 7.