Animal identity recognition implementation method and device based on deep learning eyeprint features

By using a deep learning-based eye vein feature recognition method, the eye vein region is extracted using a double ellipse geometric transformation algorithm. Combined with convolutional neural networks and attention mechanisms, this method solves the problem of low efficiency in animal identification in existing technologies, achieving fast and accurate individual animal identification. It is applicable to a variety of animals, especially in the wild.

CN121963283APending Publication Date: 2026-05-01CHENGDU INSTITUTE OF BIOLOGY CHINESE ACADEMY OF SCIENCES
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHENGDU INSTITUTE OF BIOLOGY CHINESE ACADEMY OF SCIENCES
Filing Date
2026-01-26
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing animal identification technologies are difficult to use efficiently and non-invasively to identify individual animals in the wild, especially for animals with indistinct or difficult-to-collect iris and retinal features. Furthermore, existing methods are expensive, computationally complex, or require long-term video sequence acquisition, resulting in low identification efficiency.

Method used

We employ a deep learning-based eye pattern feature recognition method. We collect animal eye data through multi-angle scanning video, extract the eye pattern region using the double ellipse geometric transformation algorithm, and combine convolutional neural networks and attention mechanisms for rapid identification, achieving non-invasive and accurate individual animal identification.

Benefits of technology

It achieves rapid and accurate animal identification with low equipment requirements, is applicable to a variety of animals, has an identification accuracy rate of over 90%, supports on-site or near real-time processing, reduces hardware costs and operational complexity, and is suitable for complex field environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121963283A_ABST
    Figure CN121963283A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of animal identification, and particularly relates to an animal identity identification implementation method and device based on deep learning eyeprint features. In order to solve the problem that in the prior art, the identity of an animal individual cannot be quickly, accurately and noninvasively recognized at low cost, the invention provides a method for recognizing the identity of the animal individual, and the method comprises the following steps: collecting data; preprocessing the data; animal eyeball area mask extraction; estimating an animal eyeprint area mask; and identity feature preprocessing and identity recognition. The invention provides a novel identity recognition method suitable for animals with eyeprint features, and the method has the advantages of low equipment use requirements and capability of quickly, conveniently and accurately recognizing the individual identities of the animals.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of animal identification, specifically relating to a method and apparatus for animal identification based on deep learning eye vein features. Background Technology

[0002] Currently, animal identification systems are being used more and more widely in nature reserves, wildlife research institutions, conservation organizations, zoos, and various agencies and institutions such as customs quarantine, agriculture, forestry, and ecology, playing an important role in wildlife population monitoring, individual identification and tracking, and anti-poaching law enforcement.

[0003] Existing non-invasive animal identification systems mainly include iris recognition, retinal recognition, gait analysis, facial recognition, and fecal DNA analysis. These technologies have achieved good results for specific animals in certain scenarios, but they still face the following challenges:

[0004] Iris recognition requires extremely close-range photography, demands high levels of animal cooperation, and uses expensive specialized equipment. Furthermore, some animals, such as hagfish, olm, certain cave blind fish, and moles (with extremely poor vision), lack well-developed irises and retinas, or even eyeballs, thus lacking any identifiable iris features. Additionally, some animals, such as cats, foxes, crocodiles, and geckos, have vertical pupils; while goats, octopuses, and squid have horizontal pupils, W-shaped pupils, or other irregular pupil shapes. Existing iris scanners are typically optimized for circular pupils, making it difficult to perform standardized image acquisition and normalization processing for non-circular pupils.

[0005] Retinal scanning requires specialized infrared scanning equipment, must be performed very close to the animal's eye, and is virtually impossible to use in the field. Furthermore, retinal scanning requires projecting a beam of light into the fundus of the eye, and for small animals (such as rodents, birds, and fish), the eyeballs are too small to safely and accurately acquire clear images of blood vessels. Additionally, in some birds, reptiles (such as snakes and lizards), and fish, the nictitating membrane (third eyelid) or the rigid scleral bone (scleral ring) covers or protects the eyeball, making clear scanning of iris texture or retinal vessels extremely difficult or even impossible.

[0006] Gait analysis requires collecting long-term continuous video sequences for model training, resulting in high computational complexity and significant influence from terrain and motion states. Some wild animals (such as lizards or chameleons) live in complex outdoor environments and possess camouflage capabilities, making it extremely difficult to accurately and efficiently quantify their gait. Furthermore, the interference from non-planar surfaces on gait features must be considered.

[0007] Facial recognition is greatly affected by changes in lighting and angle. Animal facial hair and expressions can cause variations in features, and some individual animals have very similar facial features, making confusion easy. Furthermore, facial recognition technologies generally require capturing frontal facial information, while some animals naturally tend to face the observer or camera from the side, making side-view capture less invasive. Moreover, the head or facial structure of many animals makes frontal capture difficult, such as dolphins, whales, and seals among fish; parrots and falcons among birds; and various lizards, snakes, horses, cattle, and deer among reptiles.

[0008] DNA analysis of feces, hair, etc.: The testing cycle is long (several days to several weeks), the cost is high, the analysis requires laboratory support, and the samples are easily degraded.

[0009] Therefore, current animal identification methods all have obvious shortcomings, and there is an urgent need for a method that can identify animals efficiently, non-invasively, and reliably. Summary of the Invention

[0010] The purpose of this invention is to provide a method and apparatus for animal identification based on deep learning eye vein features.

[0011] To achieve the above-mentioned objectives, the technical solution adopted by this invention is: a method for identifying individual animals, characterized by comprising the following steps:

[0012] S1. Data Acquisition: Scan the left and right sides of the animal to be identified while it is stationary, collect perspective projection data from different azimuth and elevation angles, and record the individual's ID, acquisition time, and lighting conditions.

[0013] S2. Data preprocessing: Convert the acquired data into image frames and remove invalid image frames;

[0014] S3. Animal eye region mask extraction: Extract the pixels of the eye region of the animal to be identified through video instance segmentation operation;

[0015] S4. Animal eyeprint region mask estimation: Convert the existing eye region pixel mask into the outline of the animal eyeprint region, obtain the bounding box coordinates (Bbox) of the region through the animal eyeprint region outline, crop out the Bbox, and obtain the sub-image.

[0016] S4-1, Modeling the Eyeball: Use the best-fitting, smallest bounding ellipse to model the potentially irregular eyeball pixel mask output after step S3, obtaining a "standardized eyeball," i.e., a standardized eyeball ellipse; the modeling method for the standardized eyeball ellipse is as follows:

[0017] Input binary eye mask Its pixel set is By calculating the second central moments of this point set, a minimum circumscribed ellipse is obtained through fitting. This ellipse is centered at point (c... x ,c y ), semi-major axis a eye , short half-axis b eye The rotation angle ϕ (the angle between the major axis and the positive x-axis) is uniquely defined, and its parametric equation is as follows:

[0018] (t∈[0,2π)).

[0019] In a discrete image, the interior region enclosed by this ellipse is defined as the geometric model mask G of the eyeball. eye .

[0020] S4-2, Deriving Eye Patterns: Using the same center and rotation angle as the eyeball ellipse, the "standardized eyeball" is scaled up proportionally to obtain a new, larger ellipse, which represents the "expected outer boundary of the eye pattern region." The modeling method for the expected outer boundary ellipse of the eye pattern region is as follows:

[0021] Eye wrinkles oval E print With the oval shape of the eyeball E eye Concentric and oriented, but their axes are enlarged proportionally: a print =α·a eye ,b print =β·b eye Where α and β are magnification factors; the eye wrinkle ellipse E print The parametric equation is:

[0022]

[0023] The inner region enclosed in the image is defined as the outer boundary mask G of the eye pattern. print .

[0024] The methods for obtaining the magnification factors α and β include the following steps:

[0025] S4-2-1. Data Preparation: Collect N high-quality side-view images of the target species' eyes, perform detailed annotation, and obtain N pairs of ground truth: the eye mask G of the N images. eye With eye wrinkle area frame B box_print ;

[0026] S4-2-2 Calculate the "true" magnification factor for a single image.

[0027] S4-2-2-1, Fitting the ellipse of the eyeball

[0028] The eyeball mask G for the i-th image eye P is the set of coordinates of all foreground pixels in i. eye i, for the point set P eyei performs least-squares ellipse fitting to obtain an optimally fitted ellipse E. eye i, the ellipse E eye i is from the center point (c) x i, c y i) Major semi-axis a eye i. Short semi-shaft b eye i and the rotation angle φi are uniquely defined;

[0029] S4-2-2-2, Fitting the True Value of the Outer Ellipse of the Eye Wrinkle

[0030] To obtain the ellipse E eye i. For concentric, oriented ellipses that best enclose the true eye wrinkle region, perform the following operations:

[0031] Obtain the outermost closed irregular contour C of the eye wrinkle region mask. print i; outline C print Using all points on i as the input set, fit a new minimum bounding ellipse E. print i, the parameters of the ellipse are denoted as: center (c x' i, c y' i) Major semi-axis a print i. Short semi-shaft b print i. Rotation angle φ'i; Check and ensure: center alignment, i.e. (c x' i, c y' i) = (c x i,c y i) Angle alignment, i.e., φ'i = φi, using E eye The center and angle of i, combined with C print i Fitted axis length a print i and b print i, together constitute the true external ellipse parameters used for the final calculation;

[0032] S4-2-2-3, Calculate the magnification factor of a single image

[0033] Calculate the true local magnification factor of the i-th image in the horizontal and vertical directions: Magnification factor α_i = a print i / a eye i; Height-direction magnification factor β_i = b print i / b eye i; obtain the true magnification pair (αi, βi) corresponding to the i-th image;

[0034] S4-2-2-4 Determining the Global Magnification Factor of Species

[0035] After traversing and processing all N images, N pairs of magnification factors are obtained: {(α1, β1), (α2, β2), ..., (αN, βN)}. The average value M of the two sequences {αi} and {βi} is calculated respectively. The global width magnification factor α = M({α_i}) and the global height magnification factor β = M({β_i}).

[0036] S4-3. Generate a circular mask: Calculate the two elliptical mask regions obtained in steps S4-1 and S4-2 respectively, and then calculate the difference between the sets of foreground pixels of the two elliptical masks to obtain the actual eye pattern region.

[0037] S4-4. Extracting the Contour and Bounding Box: Extract the outermost contour of the actual eye wrinkle region and the smallest bounding rectangle used for image cropping to obtain the eye wrinkle region sub-image. The contour is the set of outer boundary pixels of the ring mask, and the bounding box is the smallest rectangle containing the contour.

[0038] S5. Identity feature preprocessing: Using the sub-image obtained in step S4 as input, perform color standardization and batch organization processing to reduce the influence of non-identity factors.

[0039] S6. Identity Recognition.

[0040] Accordingly, a computer device / apparatus / system includes a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method.

[0041] Accordingly, a computer-readable storage medium stores a computer program / instructions thereon, which, when executed by a processor, implement the steps of the method.

[0042] Accordingly, a computer program product includes a computer program / instruction that, when executed by a processor, implements the steps of the method.

[0043] This invention offers the following advantages: It provides a novel method for identifying animals with eye-print features, characterized by low equipment requirements, speed, convenience, and relatively accurate identification of individual animals. Specifically, the advantages of this invention include:

[0044] Non-invasive identification with wider applicability: This invention is based on eyeprint feature recognition, which does not require physical contact or capture of animals, avoiding the trauma, infection risk and physiological stress caused by ear tags, implanted chips and other methods. It is particularly suitable for long-term monitoring and protection of rare and sensitive wild species.

[0045] Low equipment requirements and easy deployment: Compared with iris / retinal recognition, which relies on dedicated infrared equipment and close-range shooting, this invention can use ordinary high-definition digital cameras or smartphones to collect images at medium and long distances, significantly reducing hardware costs and operating thresholds, and is more suitable for flexible deployment in complex outdoor environments.

[0046] High feature stability and strong anti-interference ability: The eye pattern area is less affected by factors such as lighting, angle, and animal expression than the overall facial features. Combined with deep learning-based feature alignment and embedding technology, the robustness of the model to pose changes, local occlusion and complex backgrounds is effectively improved, and the recognition accuracy is high (accuracy exceeds 90%).

[0047] Rapid and non-invasive identification, supporting near real-time processing: Unlike gait analysis, which requires long-term video sequences or DNA testing, which requires several days of laboratory procedures, this invention relies on convolutional neural networks and attention mechanisms to quickly complete feature extraction and matching based on a single eye image, achieving real-time or near real-time identification on-site, greatly improving the efficiency of scientific research and monitoring work.

[0048] The method provided by this invention has strong universality and is applicable to all animals with eye stripe features and whose eye stripe features have intraspecific differences or same-species recognition functions, including but not limited to: (1) Aquatic and amphibious animals, represented species include: dolphins, whales, seals, sea turtles, and crocodiles. When swimming in water, this group often presents a side view, with the eyes located on both sides of the head, which facilitates the acquisition of side images at medium to long distances. The eye stripe features remain relatively stable under different lighting conditions, and the pupil shape is mostly circular or nearly circular, which is compatible with existing image processing algorithms. (2) Terrestrial mammals, represented species include: ungulates (horses, cattle, deer, antelopes), rodents (rabbits, guinea pigs), and some carnivores (foxes, leopard cats). These animals often maintain a side orientation when grazing or resting, with regular hair distribution in the eye area and significant eye stripe features (such as piercing eye stripes). The pupils are mainly horizontal or vertical elliptical, and feature standardization can be achieved through geometric correction. (3) Birds, represented species include: Brown-winged Tern, Wedge-tailed Shrike, Tiger Shrike, Brown-browed Warbler, Eagle, Parrot, etc. These animals have a high-contrast combination of eyebrow stripes and eye stripes, and a high proportion of side views when flying or foraging. The eye area is not obscured by feathers, and the texture features are clear, making it suitable for multi-angle image acquisition and deep learning feature extraction. (4) Reptiles, represented species include: Lizards, Snakes, Turtles, Crocodiles. The eye scales of these animals have individual specificity, and the high transparency of the nictitating membrane does not affect imaging. Sunbathing behavior provides a static acquisition window, and side view acquisition is highly safe. (5) Amphibians, represented species include: Caudata (e.g., Giant Salamander, Newt) and Anura (e.g., Frog, Toad). These animals have unique net-like or spotted textures in their irises, and their protruding eyeballs make it easy to acquire images, and their eye stripe shapes and colors are rich.

[0049] In summary, this invention provides a novel method for animal identification using iris patterns, which has the advantages of low equipment requirements, simple operation, low cost, wide applicability, accuracy, and speed. Attached Figure Description

[0050] Figure 1 This is a schematic diagram of the method flow of the present invention;

[0051] Figure 2 A flowchart illustrating one possible method for obtaining the magnification factor. Detailed Implementation

[0052] This invention provides a method for animal identification, such as... Figure 1 As shown, the method specifically includes the following steps:

[0053] S1. Data Acquisition (Identity Information Acquisition). Multi-angle high-definition camera equipment is used to scan and record the left and right sides of the face of the animal to be identified while it is stationary. Perspective projection data is collected from different azimuth and elevation angles, and the individual's ID, acquisition time, and lighting conditions are recorded.

[0054] S2. Data Preprocessing. The acquired scanned video is converted into image frames, and the image frames are cleaned to remove invalid image frames containing motion blur, focus failure, or incomplete composition.

[0055] S3. Animal Eye Region Mask Extraction. Through at least one round (usually only one round) of video instance segmentation, the pixels of the eye region of the animal to be identified are extracted to obtain the eye region pixel mask. The video instance segmentation operation can be performed manually or using existing mature software. For example, the API provided by the Ultralytics HUB open-source code library can be used to call YOLO26-seg (reference: https: / / docs.ultralytics.com / zh / guides / instance-segmentation-and-tracking / #samples), which can automatically call the video instance segmentation model to perform video instance segmentation.

[0056] S4. Animal eyeprint region mask estimation. Using the original "Dual-Ellipse Geometric Transformation Algorithm" (D-EGTA) of this invention, the pixel mask of the eyeball region obtained in step S3 (file format: eyeball_mask) is converted into the outline of the animal eyeprint region (file format: eyeprint_contour). The bounding box coordinates (Bbox) of the animal eyeprint region are obtained from the animal eyeprint region outline. This Bbox is cropped out and used as the input sub-image for identity recognition in subsequent processing. The eyeprint_mask (eyeprint region mask) is obtained from the animal eyeprint region outline. Interference information such as non-eyeprint and non-animal pixels in the Bbox is removed, finally obtaining the sub-image with interference information removed. The specific operations of this step include:

[0057] S4-1, Modeling the Inner Ellipse: The potentially irregular eyeball region pixel mask (eyeball_mask) output after video instance segmentation in step S3 is modeled using the best-fitting, smallest bounding ellipse to obtain the eyeball ellipse. This ellipse represents the "standardized eyeball." The eyeball ellipse modeling method is as follows:

[0058] Input binary eye mask (i.e., the pixel mask of the eyeball region obtained in step S3), its pixel set is By calculating the second-order central moments of this point set, the foreground region in the eyeball mask is fitted to obtain the minimum bounding ellipse. This ellipse is formed by the center point (c... x ,c y ), semi-major axis a eye , short half-axis b eye The rotation angle ϕ (the angle between the major axis and the positive x-axis) is uniquely defined, and its parametric equation is as follows:

[0059] , t∈[0,2π).

[0060] In the formula, t is the eccentric angle, a variable in the parametric equation describing the ellipse profile. When it varies within the interval [0, 2π), t can traverse every point on the ellipse, completing one complete profile depiction. Its geometric meaning is: the ellipse can be considered as an object stretched by α in the X-axis direction. eye It was stretched by b times in the Y-axis direction. eye The unit circle is a circle with a radius of 1. On this unit circle, the coordinates of a point at angle t are (cos(t), sin(t)). Points on the ellipse are the coordinates of points on this unit circle multiplied by their respective semi-axis lengths.

[0061] In the discrete image, the ellipse Eeye The internal region enclosed by (t) is defined as the geometric model mask G of the eyeball. eye That is, the foreground area in the eyeball mask.

[0062] S4-2, Outer Ellipse Derivation: Based on morphological experience (using the crocodile lizard as an example, the width is magnified 6 times and the height 4.5 times), a new, larger ellipse is calculated using the same center and rotation angle as the eyeball ellipse. This ellipse represents the "expected outer boundary of the eye stripe region." The method for modeling the outer ellipse is called the eye stripe ellipse E. print The parametric equation is:

[0063]

[0064] In E print (t) The internal region enclosed by the ellipse is defined as the outer boundary mask G of the eye pattern. print .

[0065] Based on biostatistical priors, the ellipse of the eye wrinkle is E print With the oval shape of the eyeball E eye Concentric and oriented, but their axes are enlarged proportionally: a print =α·a eye ,b print =β·b eye .

[0066] Where α and β are magnification factors, the specific magnification values ​​are determined according to the species of the animal to be identified; for example, for the crocodile lizard, the magnification factors can be selected as α=6.0 and β=4.5. For other non-lizard animals with eye stripes, the α and β magnification factors can be determined through morphological observation and experience, confirming the proportional magnification relationship from the animal's eyeball to the outermost edge of the eye stripe, thus setting α and β to enlarge the ellipse. Alternatively, they can be obtained through morphological methods of measurement and calculation; the specific calculation method is as follows... Figure 2 As shown, the method includes the following steps:

[0067] S4-2-1. Data Preparation: Collect N high-quality side-view images of the target species' eyes and perform detailed annotation, specifically including: eyeball masking (G... eye Perform pixel-level annotation; use interactive open-source software to annotate the eye vein region mask (e.g., the open-source software Labelme can be used); calculate the minimum bounding rectangle of the mask to obtain the eye vein region bounding box, that is, the minimum bounding rectangle of the eye vein mask region, i.e., G eye Convert to B box_print Thus, N pairs of true values ​​are obtained.

[0068] S4-2-2 Calculate the "true" magnification factor for a single image.

[0069] For the N pairs of true values ​​obtained in step S4-2-1 (i.e., G of the i-th image) eye i and B box_print i) Processing is performed, where i∈[1,N]. This step aims to use finely annotated ground truth data to deduce the true geometric magnification ratio of the "eye wrinkle ellipse" relative to the "eyeball ellipse" in each image. The processing steps are as follows:

[0070] S4-2-2-1, Fitting the ellipse of the eyeball

[0071] The pixel-level labeled eyeball mask G in the i-th image eye i. Process: Extract G eye The set of coordinates P of all foreground pixels in i eye i. Point set P eye i. Perform least-squares ellipse fitting (least-squares ellipse fitting is a mature existing technique, for example, it can be performed using the fitEllipse function of the open-source software OpenCV), to obtain an optimally fitted ellipse E. eye i. The ellipse E eye i is from the center point (c) x i, c y i) Major semi-axis a eye i. Short semi-shaft b eye The values ​​of i and the rotation angle φi (the angle between the major axis and the horizontal axis of the image) are uniquely defined. This ellipse E eye i is the geometric model of the "standardized eyeball".

[0072] S4-2-2-2, Fitting the True Value of the Outer Ellipse of the Eye Wrinkle

[0073] To obtain an oval shape similar to the eyeball E eye i. For concentric, oriented ellipses that best enclose the true eye wrinkle region, perform the following operations:

[0074] ① Extract the outer contour of the eye wrinkle region: Based on the eye wrinkle region mask obtained in step S4-2-1, use a contour extraction algorithm (a conventional existing technology, such as findContours in open-source software OpenCV) to obtain its outermost closed irregular contour C. print i. ② Fitting the outer ellipse: The contour C print Using all points on i as the input set, fit a new minimum bounding ellipse E. print i. The parameters of this ellipse are denoted as: center (c x' i, c y' i) Major semi-axis a print i. Short semi-shaft b printi. Rotation angle φ'i. ③ Geometric alignment verification and correction: Theoretically, the true value eye wrinkle region should be concentric and in the same direction as the eyeball region. Therefore, check and ensure: center alignment, i.e. (c x' i, c y' i) = (c x i, c y i). Angle alignment, i.e., φ'i = φi. In subsequent calculations, E is used directly. eye The center and angle of i, combined with C print i Fitted axis length a print i and b print i, together constitute the true external ellipse parameters used for the final calculation.

[0075] S4-2-2-3, Calculate the magnification factor of a single image

[0076] Based on the premise that "the ellipse of the eye pattern is a fixed-scale magnification of the ellipse of the eyeball," calculate the true local magnification factor of the i-th image in the horizontal and vertical directions: Width direction magnification factor α_i = a print i / a eye i. Height-direction magnification factor β_i = b print i / b eye i. Thus, the true magnification pair (αi, βi) corresponding to the i-th image is obtained.

[0077] S4-2-2-4 Determining the Global Magnification Factor of Species

[0078] After processing all N images, N pairs of magnification coefficients {(α1, β1), (α2, β2), ...,(αN, βN)} are obtained. To eliminate possible annotation noise or fitting errors in a single image and to obtain a robust global geometric prior representing the target species, the N samples are statistically summarized.

[0079] At this point, we can directly calculate the average value M of the two sequences {αi} and {βi}. We then use the average value M as the final fixed scaling parameter for the Dual Elliptic Geometric Transformation (D-EGTA) algorithm, with the global width scaling factor α = M({α_i}) and the global height scaling factor β = M({β_i}).

[0080] Alternatively, linear regression can be used to fit and obtain α and β. Using linear regression, the sequences {α_real i}, {β_real i}, {a_eye i}, and {b_eye i} are fitted to obtain w1, w2, w3, w4, bα, and bβ. These results are used as the final fixed scaling parameters for the Dielliptic Geometric Transformation (D-EGTA) algorithm: global width scaling factor α* = w1·a_eye + w2·b_eye + bα, and global height scaling factor β* = w3·a_eye + w4·b_eye + bβ. α* and β* are the scaling factors obtained through fitting, infinitely close to the ideal optimal values. At this point, α* and β* are used as the geometric scaling factors (α, β) for the target species.

[0081] S4-3. Generate a circular mask (eyeprint_mask): Calculate the two elliptical mask regions obtained in steps S4-1 and S4-2 respectively, and then calculate the difference between the sets of foreground pixels of the two elliptical masks to obtain a circular mask region, which is the actual area M of the eye print. print This ring-shaped region is the relatively accurate eyeprint mask output by the algorithm. M print It is the annular region formed by subtracting the inner circle of the pupil from the inner circle of the eye ellipse, achieved through pixel-level set difference operations: M print =G print \G eye The backslash "\" represents the set difference operator.

[0082] That is, the final eye pattern mask is the result of subtracting the inner ellipse mask from the outer ellipse mask.

[0083] S4-4. Extracting Contours and Bounding Boxes: Extract the outermost contour (eyeprint_contour) of the eyeprint_mask and the minimum bounding rectangle (eyeprint_Bbox) used for image cropping to obtain the sub-image. The method for obtaining these is as follows:

[0084] Outline: C print =Boundary(M print ), that is, mask M print The set of pixels representing the outer boundary of a bounding box. print =BoundingBox(C print (), is the smallest upright rectangle Bbox that contains the entire outline.

[0085] In general, this step involves cropping a rectangular area of ​​pixels, i.e., a sub-image, using the top, bottom, left, and right boundary coordinates (Bbox) of the foreground area of ​​the object mask.

[0086] S5. Identity Feature Preprocessing: Using the sub-image obtained in step S4 as input, perform color normalization and batch processing (normalize pixel values ​​to the [0,1] range and collate different input sample images into batches) to reduce the influence of non-identity factors. This step can be completed using open-source packages such as Tensorflow, Keras, PyTorch, Torchvision, or PaddlePaddle. This step is only necessary when parallel training, evaluation, and inference are performed to accelerate computation. If only one sample is input for processing at a time, this step is unnecessary to accelerate computation (it can be executed but is meaningless).

[0087] S6. Identity Recognition: Load the ResNeXt deep learning model built on CNN and Attention modules, load the ImageNet1K pre-trained weights, perform model training operations using collected and labeled image data, optimize the model through data augmentation and scheduling strategies, and convert standardized images into high-dimensional feature embedding vectors to achieve effective differentiation of different individuals.

[0088] S7. Identity Recognition Model Inference: Using the trained identity recognition artificial neural network, process the side view of the animal's head at the identity location according to steps S1-S5 to obtain the predicted ID of the individual animal and give the expected confidence level. The larger the expected confidence level (confidence_socre), the more confident the result is.

[0089] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Unless otherwise specified, the technical means used in the embodiments are conventional means well known to those skilled in the art, and the data obtained are all average values ​​obtained after at least three repetitions, and each repetition yields valid data.

[0090] Example: Tracking and identifying wild crocodile lizards based on eye pattern features

[0091] An animal identification software system was designed using the method provided in this invention, and individual identification of crocodile lizards was performed. Specifically, the system includes the following steps:

[0092] S1. Data Acquisition. A wild population of the Yaoshan Crocodile Lizard (Shinisaurus crocodilurus), belonging to the class Reptilia, order Squamata, suborder Scalypiformes, family Crocodilianidae, and genus Shinisaurus, was selected as the research subject from the field monitoring point of the Dagui Mountain National Nature Reserve in Guangxi Zhuang Autonomous Region. At pre-established fixed observation points, a high-resolution digital SLR camera (Nikon D300) equipped with a telephoto lens (f / 25 aperture, ISO-200, focal length 65mm) and a ring light was used to acquire images of known individuals (identity IDs: LK001 to LK020) through non-contact image acquisition.

[0093] During data collection, ensure the camera is handheld, focusing on capturing clear side-view images of the crocodile lizard's head to fully reveal its unique radial scales and pigment deposits forming the "eye stripes" around the eyes. At least 50 valid side-view images of each individual were collected on different dates and under different lighting conditions (morning, afternoon, and cloudy), resulting in an initial identification database containing 1000 labeled images. Metadata such as individual ID, shooting time, and shooting parameters were recorded during the data collection process.

[0094] S2. Data Preprocessing. The acquired scanned video recordings were converted into image frames, and all acquired images underwent standardization. First, researchers manually reviewed and removed invalid images that were blurry, had obscured eye vein areas, had head angles deviating from the side view by more than ±30°, or exhibited strong specular reflections. Then, the retained valid images underwent uniform processing: the image resolution was adjusted from 2868×4320 to 1024×768 pixels, automatic white balance and mild histogram equalization were applied to reduce lighting differences, and the images were converted to RGB three-channel format. Data augmentation operators such as ColorJitter, RandomResizedCrop, and RandomRotation were used to construct diverse identity recognition datasets. Finally, the training, validation, and test sets were randomly divided in an 8:1:1 ratio to ensure no overlap in individual IDs between different sets.

[0095] S3. Extraction of the animal's eyeball region mask. The images preprocessed in step S2 are sequentially imported into the software provided by this invention. For each image, the operator uses the software's built-in interactive tool to mark any pixel within the eyeball region by clicking with the mouse. The system then calls the integrated video instance segmentation basic model to automatically generate a high-precision eyeball_mask (eyeball pixel mask).

[0096] S4. Animal eyeprint region mask estimation. In the software provided by this invention, the "double ellipse geometric transformation algorithm" of this invention is used to automatically derive and generate the eyeprint_mask (eyeprint region mask) surrounding the eyeball according to the geometric attributes (center, major and minor axes) of the eyeball_mask at a predetermined ratio (width magnified 6 times, height magnified 4.5 times). In the software system, the pure eyeprint region sub-image is automatically cropped according to the bounding rectangle of the eyeprint_mask, and the sub-image is bound to the real individual ID (such as "LK005") recorded in the image metadata, which is used as the training and testing sample for the identity recognition deep learning model.

[0097] S5. Identity Feature Preprocessing: The software's feature preprocessing module receives the eye vein region sub-image obtained in step S4, performs batch standardization, normalizes the pixel values ​​to the [0,1] interval, and organizes the data in batches to prepare for model input.

[0098] S6. Identity Recognition: In the identity recognition module of the software, a ResNeXt deep learning network architecture based on CNN and Attention mechanisms is loaded, along with pre-trained weights from the ImageNet1K dataset to accelerate convergence. The model is trained using the prepared training set (approximately 800 samples). During training, data augmentation strategies such as random rotation and brightness fine-tuning are employed to improve the model's generalization ability. The training objective is to convert the input iris pattern image into a high-dimensional feature embedding vector and map it to the corresponding individual ID through a fully connected layer. During training, the software calculates the recognition accuracy in real time on the validation set (approximately 100 samples). When the validation set accuracy no longer improves for 10 consecutive training epochs, training automatically stops and the best-performing model weights are saved.

[0099] S7. Closed Testing and Validation: The trained optimal model is tested using a test set (100 samples, corresponding to 10 individuals) that was not used in training. The software automatically loads the test images, repeats the process of extracting from eyeball_mask to eyeprint_mask and then cropping, and then inputs the cropped eyeprint sub-image into the trained identity recognition model to obtain the predicted individual ID and prediction confidence_score.

[0100] Results: In the closed test of this embodiment, the software achieved an average identity recognition accuracy of 98.0% on the test set. Specifically, out of 100 test images, only one image was misidentified due to extreme head posture causing iris distortion, and another image was classified as an "unknown individual" because severe eye reflection during shooting resulted in a confidence score below the threshold (0.6). For correctly identified samples, the average prediction confidence score was as high as 0.92.

[0101] The results validate the effectiveness of the method presented in this invention: First, through the process of "eyeball mask localization → special algorithm conversion → eye pattern region cropping," key biological feature regions can be stably and automatically extracted from complex natural backgrounds, greatly reducing interference from irrelevant information. Second, the identity recognition deep model trained based on this pure feature region can learn subtle and unique individual differences in the eye patterns of crocodile lizards, thereby achieving high-precision and high-confidence individual identification. This provides a reliable technical tool for long-term, non-invasive individual monitoring and population dynamics research of wild animals with significant eye pattern features, such as crocodile lizards, without the need for physical markers.

[0102] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Any modifications, alterations, substitutions, or variations made by those skilled in the art to the technical solutions of the present invention without departing from the spirit of the present invention shall fall within the protection scope defined by the claims of the present invention.

Claims

1. A method for identifying an individual animal, characterized in that, Includes the following steps: S1, Data Acquisition; S2. Data preprocessing: Convert the acquired data into image frames and remove invalid image frames; S3. Animal eye region mask extraction: Extract the pixels of the eye region of the animal to be identified through video instance segmentation operation; S4. Animal eyeprint region mask estimation: Convert the existing eye region pixel mask into the outline of the animal eyeprint region, obtain the bounding box coordinates (Bbox) of the region through the animal eyeprint region outline, crop out the Bbox, and obtain the sub-image. S5. Identity feature preprocessing: Using the sub-image obtained in step S4 as input, perform color standardization and batch organization processing to reduce the influence of non-identity factors. S6. Identity Recognition.

2. The method according to claim 1, characterized in that: In step S1, the left and right side faces of the animal to be identified are scanned and recorded while it is stationary. Perspective projection data is collected from different azimuth and elevation angles, and the individual's ID, collection time, and lighting conditions are recorded.

3. The method according to claim 1, characterized in that: Step S4 includes the following steps: S4-1, Modeling the eyeball: Model the pixel mask of the eyeball region output after step S3 using the best-fitting, smallest circumscribed ellipse to obtain the "standardized eyeball", that is, the eyeball ellipse. S4-2, Deriving eye patterns: Using the same center and the same rotation angle of the eyeball ellipse, the "standardized eyeball" is enlarged proportionally to obtain a new, larger ellipse, which is the "outer boundary of the expected eye pattern area". S4-3. Generate a circular mask: Calculate the two elliptical mask regions obtained in steps S4-1 and S4-2 respectively, and then calculate the difference between the sets of foreground pixels of the two elliptical masks to obtain the actual eye pattern region. S4-4. Extracting Contours and Bounding Boxes: Extract the outermost contour of the actual eye wrinkle region and the smallest bounding rectangle used for image cropping to obtain the eye wrinkle region sub-image.

4. The method according to claim 3, characterized in that: In step S4-1, the standardized method for modeling the ellipse of the eyeball is as follows: Input binary eye mask Its pixel set is By calculating the second central moments of this point set, a minimum circumscribed ellipse is obtained through fitting. This ellipse is centered at point (c... x ,c y ), semi-major axis a eye , short half-axis b eye The rotation angle ϕ is uniquely defined, and its parametric equation is as follows: t is the eccentric angle, t∈[0,2π). In a discrete image, the interior region enclosed by this ellipse is defined as the geometric model mask G of the eyeball. eye .

5. The method according to claim 4, characterized in that: In step S4-2, the expected ellipse modeling method for the outer boundary of the eye wrinkle region is as follows: Eye wrinkles oval E print With the oval shape of the eyeball E eye Concentric and oriented, but their axes are enlarged proportionally: a print =α·a eye ,b print =β·b eye Where α and β are magnification factors; the eye wrinkle ellipse E print The parametric equation is: , The inner region enclosed in the image is defined as the outer boundary mask G of the eye pattern. print .

6. The method according to claim 5, characterized in that: The methods for obtaining the magnification factors α and β include the following steps: S4-2-1. Data Preparation: Collect N high-quality side-view images of the target species' eyes, perform detailed annotation, and obtain N pairs of ground truth: the eye mask G of the N images. eye With eye wrinkle area frame B box_print ; S4-2-2 Calculate the "true" magnification factor for a single image. S4-2-2-1, Fitting the ellipse of the eyeball Extract the eyeball mask G from the i-th image. eye P is the set of coordinates of all foreground pixels in i. eye i, for the point set P eye i performs least-squares ellipse fitting to obtain an optimally fitted ellipse E. eye i, the ellipse E eye i is from the center point (c) x i, c y i) Major semi-axis a eye i. Short semi-shaft b eye i and the rotation angle φi are uniquely defined; S4-2-2-2, Fitting the True Value of the Outer Ellipse of the Eye Wrinkle To obtain the ellipse E eye i. For concentric, oriented ellipses that best enclose the true eye wrinkle region, perform the following operations: Obtain the outermost closed irregular contour C of the eye wrinkle region mask. print i; outline C print Using all points on i as the input set, fit a new minimum bounding ellipse E. print i, the parameters of the ellipse are denoted as: center (c x' i, c y' i) Major semi-axis a print i. Short semi-shaft b print i. Rotation angle φ'i; Check and ensure: center alignment, i.e. (c x' i, c y' i) = (c x i, c y i) Angle alignment, i.e., φ'i = φi, using E eye The center and angle of i, combined with C print i Fitted axis length a print i and b print i, together constitute the true external ellipse parameters used for the final calculation; S4-2-2-3, Calculate the magnification factor of a single image Calculate the true local magnification factor of the i-th image in the horizontal and vertical directions: Magnification factor α_i in the width direction = a print i / a eye i; Height-direction magnification factor β_i = b print i / b eye i; Obtain the true magnification pair (αi, βi) corresponding to the i-th image; S4-2-2-4 Determining the Global Magnification Factor of Species After traversing and processing all N images, N pairs of magnification factors are obtained: {(α1, β1), (α2, β2), ..., (αN,βN)}. The average value M of the two sequences {αi} and {βi} is calculated respectively. The global width magnification factor α = M({α_i}) and the global height magnification factor β = M({β_i}).

7. The method according to claim 3, characterized in that: In step S4-4, the contour is the set of pixels representing the outer boundary of the annular mask, and the bounding box is the smallest rectangle containing the contour.

8. A computer device / equipment / system, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 7.

10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 7.