A rotation-consistent target-aware high-frequency wild animal re-identification method
By constructing a branch network of the visual transformer and a target-frequency joint selection mechanism, the problem of insufficient generalization ability of wildlife re-identification in multi-species scenarios is solved. High-frequency texture adaptive selection and rotation robustness in complex backgrounds are achieved, improving recognition accuracy and stability.
Patent Information
- Application Number
- CN202610793011.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-03
- Publication Date
- 2026-07-10
AI Technical Summary
Existing wildlife re-identification methods lack generalization ability in multi-species scenarios, struggle to adaptively select high-frequency textures related to the animal subject in complex natural backgrounds, and are not robust to rotation and posture changes, resulting in decreased recognition accuracy and stability.
A visual transformer is used to construct the original visual branch, the high-frequency enhancement branch, and the rotation-consistent target high-frequency branch. The image patch with significant high-frequency details is identified through the target-frequency joint selection mechanism, and feature-level rotation and consistency constraints are applied to it to suppress background noise and enhance the robustness of orientation changes.
It improves the accuracy and stability of individual identification of multi-species wild animals, reduces sensitivity to complex backgrounds, enhances the robustness of the model under rotation and pose changes, and is more adaptable.
Smart Images

Figure CN122369069A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision, deep learning, target re-identification, and individual wildlife identification, specifically a rotation-consistent target perception method for high-frequency wildlife re-identification. Background Technology
[0002] Wildlife re-identification aims to identify the same individual animal from images or videos taken by different cameras, at different locations, or at different times. Unlike conventional animal classification tasks, wildlife re-identification requires not only determining the species to which the animal belongs but also distinguishing different individuals within the same species, thus representing a more granular visual retrieval task. This task can be applied to endangered species conservation, migration route analysis, population estimation, ecological behavior monitoring, and intelligent management of nature reserves.
[0003] Existing wildlife re-identification methods mainly fall into three categories: the first is global feature learning methods for the entire image, which typically borrow from person re-identification models to extract global representations of the whole image; the second is species-specific local feature extraction methods, such as designing recognition algorithms for specific body regions like whale tails, seal fur, tiger stripes, cow heads, and elephant ears; and the third is methods that fuse auxiliary information such as pose, key points, and part segmentation. While these methods can achieve certain results on specific datasets or for specific species, they suffer from insufficient generalization ability, require additional annotation, and are difficult to adapt to different animal morphologies in multi-species scenarios.
[0004] For pedestrian re-identification, discriminatory cues often come from visual attributes such as clothing color, backpack, shoes, and hairstyle; while for wild animals, individual differences are more manifested in fur texture, spots, stripes, scales, ear edges, tail edges, body contours, and local details. These information typically correspond to high-frequency components in the image frequency domain—regions where pixel values change rapidly in space. Therefore, high-frequency information can serve as universal identity cues for cross-species wild animal re-identification.
[0005] However, wildlife images captured in natural environments often have complex backgrounds, such as grass, leaves, water ripples, rocks, and soil, which contain a large number of high-frequency components. Directly enhancing the high-frequency information of the entire image may cause the model to misinterpret background textures as identity cues, leading to decreased robustness. Furthermore, wildlife exhibits free posture and significant directional changes; the target may flip, rotate, pitch, turn sideways, or be occluded. If high-frequency textures are learned only from fixed spatial locations, the model becomes sensitive to rotation and posture changes. Existing feature-level rotation methods can improve rotation robustness, but they typically rotate all image patch features uniformly, failing to distinguish between high-frequency details of the animal subject and high-frequency noise in the background. Existing high-frequency enhancement methods can improve texture detail learning, but lack rotation-consistent modeling for changes in target orientation.
[0006] Therefore, there is an urgent need for a wildlife re-identification technology that can simultaneously solve the problems of "target-related high-frequency selection" and "rotational robustness". This technology would enable the model to adaptively select high-frequency textures, spots, stripes and contours related to the animal subject in complex natural backgrounds, and establish rotational consistency constraints on the selected target high-frequency regions at the feature level, thereby improving the accuracy, stability and generalization ability of multi-species wildlife individual identification. Summary of the Invention
[0007] To address the aforementioned problems, this invention provides a rotation-consistent target perception high-frequency wildlife re-identification method. This method uses a visual transformer as the backbone network, constructing an original visual branch, a high-frequency enhancement branch, and a rotation-consistent target high-frequency branch. A target-frequency joint selection mechanism identifies image patches that are truly relevant to the animal subject and have significant high-frequency details. Feature-level rotation and consistency constraints are established only for the target high-frequency tokens, thereby simultaneously suppressing background high-frequency noise and enhancing robustness against orientation changes.
[0008] To address the aforementioned technical problems, this invention provides the following technical solution: a rotation-consistent target perception method for high-frequency wildlife re-identification, comprising the following steps: S1: Obtain images of the wild animals to be trained and their individual identification labels; S2: Construct the original visual branch, input the wildlife image into the first visual transformer branch, and obtain the original image patch token, the category token, and the attention score of the category token relative to each original image patch token; S3: Construct a frequency domain hybrid high-frequency enhancement branch, perform Fourier transform on the wildlife image and obtain high-frequency components through high-pass filtering, perform frequency domain hybridization of the high-frequency components with the original frequency domain representation of the wildlife image, and obtain a high-frequency enhanced image through inverse Fourier transform; S4: Perform target-frequency joint token selection, input the high-frequency enhanced image into the second visual transformer branch to obtain high-frequency image block tokens; S5: Perform target high-frequency feature level rotation, generate target-frequency joint selection score based on the attention score and the high-frequency energy of the corresponding image block, and select target high-frequency tokens from the high-frequency image block tokens based on the target-frequency joint selection score; S6: Construct a joint loss function, perform feature-level rotation on the target high-frequency token or its corresponding two-dimensional feature map to obtain the rotated target high-frequency token, and perform individual identity classification constraints, metric learning constraints, feature balance constraints and rotation consistency high-frequency constraints based on the original global features, high-frequency global features and rotated target high-frequency features to train a wildlife re-identification model; S7: Train the wildlife re-identification model by optimizing the parameters of the visual transformer, projection layer, classification layer and related token selection module through backpropagation, so that the model learns re-identification features that have both high-frequency target discrimination ability and rotation robustness. S8: Perform inference retrieval, use the trained wildlife re-identification model to extract re-identification features of the image to be retrieved and the image in the library, and obtain the retrieval results of the same individual based on the feature distance.
[0009] In a preferred embodiment, the frequency domain mixing in step S3 includes: converting the input image into a single-channel image and then performing a two-dimensional Fourier transform to obtain the original frequency domain representation; using a Gaussian high-pass filter to retain the high-frequency components in the original frequency domain representation; constructing a random mask matrix with the same size as the original frequency domain representation, and locally mixing the high-frequency components and the original frequency domain representation according to the random mask matrix.
[0010] In a preferred embodiment, the high-frequency energy in step S5 is determined by at least one of the mean absolute value of the corresponding image block in the high-frequency enhanced image, the mean square value, the mean frequency domain amplitude, or the mean high-pass filter response.
[0011] In a preferred embodiment, the target-frequency joint selection score in step S4 is either the product of the attention score and the normalized high-frequency energy or a weighted sum of the attention score and the normalized high-frequency energy.
[0012] In a preferred embodiment, the target-frequency joint selection score in step S4 includes two-level screening: first, a set of target candidate tokens is selected based on the attention score, and then a set of target high-frequency tokens is selected within the set of target candidate tokens based on the high-frequency energy or the target-frequency joint selection score.
[0013] In a preferred embodiment, the feature-level rotation in step S5 includes: restoring the selected target high-frequency tokens to a two-dimensional feature map or a sparse feature map according to their image block coordinates; applying a rotation transformation of at least one preset angle or random angle in the two-dimensional feature map coordinate system; flattening the rotated two-dimensional feature map back into a token sequence and concatenating it with the category tokens before inputting it into the visual transformer layer.
[0014] In a preferred embodiment, the rotation-consistent high-frequency constraint in step S6 includes: restoring the features corresponding to the high-frequency token of the rotation target to the original direction coordinates through inverse rotation or index mapping, and constraining the difference between the restored high-frequency features of the rotation target and the target high-frequency features before rotation.
[0015] In a preferred embodiment, the feature equalization constraint in step S6 is used to constrain the distance between the original visual token feature corresponding to the target high-frequency token position in the original image branch and the target high-frequency token feature in the high-frequency branch.
[0016] In a preferred embodiment, step S8 includes a training phase and an inference phase. The training phase uses the original visual branch, the high-frequency enhancement branch, and the high-frequency branch of the rotated target for joint optimization. The inference phase uses only the global features of the original visual branch, or uses the fusion features of the global features of the original visual branch and the global features of the high-frequency branch for retrieval.
[0017] Compared with the prior art, the beneficial effects achieved by the present invention are: 1. This invention proposes a target-frequency joint token selection mechanism. Existing target perception high-frequency selection mainly relies on category token attention scores to select image patch locations, focusing on "target relevance" but without explicitly evaluating the sufficiency of high-frequency details at that location. This invention introduces image patch high-frequency energy on top of the attention score to obtain a target-frequency joint selection score. This score simultaneously reflects whether the image patch belongs to the animal subject discrimination region and whether the region has high-frequency details such as texture, spots, stripes, and contours. This avoids selecting regions that belong to the target but have weak high-frequency details, as well as regions with strong high frequencies but belong to background noise. It can adaptively capture common high-frequency identity cues for different species, including hair texture, spots, stripes, scales, edge contours, and local details, improving multi-species applicability. 2. This invention proposes a feature-level rotation mechanism for target-oriented high-frequency tokens. Existing feature-level rotations typically rotate all image patch features, failing to distinguish between animal subject features and background features. This invention only performs rotation modeling on the target high-frequency token obtained through joint target-frequency selection or its corresponding two-dimensional feature map. This allows rotation robustness learning to focus on identity-related details such as texture, spots, stripes, and contours of the animal subject. This mechanism reduces the risk of rotational enhancement of high-frequency background noise. By suppressing high-frequency noise from natural backgrounds such as grass, leaves, water ripples, and rocks through the joint target-frequency selection mechanism, it improves the model's ability to focus on the animal subject discrimination region. 3. This invention proposes a rotation-consistent high-frequency constraint. Existing rotation-invariant methods typically constrain the original and rotated features to be close at the global category token level, making it difficult to guarantee the stability of local high-frequency identity cues before and after rotation. This invention establishes a rotation-consistent constraint on the target high-frequency token. After restoring the rotated target high-frequency features to their original orientation coordinates through inverse rotation or index mapping, a difference constraint is applied between the rotated and unrotated target high-frequency features. This improves the consistency of fine-grained textures and contours under orientation changes. Through target high-frequency feature-level rotation and rotation-consistent high-frequency constraints, local identity cues such as textures and contours remain stable under conditions of animal posture changes, orientation rotation, and viewpoint changes. 4. This invention proposes a balanced learning approach for high-frequency features and original visual features. High-frequency features help capture fine-grained identity cues, but overemphasizing high frequencies may impair overall contours, body structure, color distribution, and spatial semantics. This invention applies feature balance constraints to the original visual tokens and high-frequency tokens at selected locations, ensuring that the high-frequency branch maintains consistency with the original visual semantics while enhancing details. Feature balance loss prevents the model from over-relying on high-frequency details, maintaining a balance between the original visual structure and high-frequency details.
[0018] 5. This invention forms a re-identification process that combines training enhancement with lightweight inference. During the training phase, high-frequency enhancement branches and rotation-consistent branches are introduced to improve robustness; during the inference phase, only the global features of the original visual branches can be used, or lightweight fusion features of the original branches and high-frequency branches can be used, thereby reducing deployment computational overhead. The training phase enhances robustness, while the inference phase maintains low computational load, making it suitable for field monitoring, nature reserve retrieval systems, and multi-species animal individual management systems. Attached Figure Description
[0019] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a schematic diagram of the system flow of the present invention; Figure 2 This is a schematic diagram of the overall process of the present invention; Figure 3 This is a schematic diagram of the frequency domain hybrid enhancement of the present invention; Figure 4 This is a schematic diagram of the target-frequency joint token selection of the present invention; Figure 5 This is a schematic diagram of the rotation of the target high-frequency feature level of the present invention; Figure 6 This is a schematic diagram of the joint loss function of this invention; Figure 7 This is a schematic diagram of the model reasoning and retrieval process of the present invention. Detailed Implementation
[0020] 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. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] like Figures 1-7 The rotation-consistent target perception high-frequency wildlife re-identification method shown includes the following steps: S1: Obtain images of the wild animals to be trained and their individual identification labels; Input images can come from camera traps, drones, surveillance cameras, handheld devices, or publicly available image datasets. Training images undergo enhancement processing such as size normalization, random cropping, random rotation, brightness perturbation, contrast perturbation, and random erasure.
[0022] S2: Input the wildlife image into the first visual transformer branch to obtain the original image patch token, the category token, and the attention score of the category token relative to each original image patch token; The image is divided into multiple fixed-size image blocks, and the original image block tokens are obtained by linear projection or convolutional projection. The learnable category tokens are concatenated and positional encoding is added before being input into the visual transformer to obtain the original image block features, category token features, and the attention distribution of the category tokens to each image block. S3: Perform Fourier transform on the wildlife image and obtain high-frequency components through high-pass filtering. Mix the high-frequency components with the original frequency domain representation of the wildlife image in the frequency domain and obtain a high-frequency enhanced image through inverse Fourier transform. S4: Input the high-frequency enhanced image into the second visual transformer branch to obtain high-frequency image block tokens. First, the input image is converted into a single-channel image, and then the original frequency domain representation is obtained through Fourier transform. The Fourier transform maps an image from the spatial domain to the frequency domain, where low-frequency components typically correspond to overall brightness, color, and large-scale structure, while high-frequency components typically correspond to edges, textures, spots, stripes, hair, and contours.
[0023] In a specific implementation, the two-dimensional discrete Fourier transform is:
[0024] Where u and v represent the frequency indices in the horizontal and vertical directions, respectively; Next, a high-pass filter is used to process the original frequency domain representation to obtain the high-frequency components. The high-pass filter can be a Gaussian high-pass filter, an ideal high-pass filter, a Butterworth high-pass filter, or a learnable high-pass filter. To enhance the model's robustness to environmental changes, this invention does not directly use pure high-frequency representations, but instead incorporates high-frequency components... Compared with the original frequency domain representation Frequency domain mixing is performed using a random mask to obtain a mixed frequency domain representation. .
[0025] In a specific implementation, the frequency domain mixing formula is as follows:
[0026] in The matrix is a random mask. Local regions set to 1 are used to introduce the original frequency domain information, while the remaining regions retain high-frequency components. α can be randomly selected from 0 to 0.5, or dynamically adjusted based on image quality, species category, or training phase. Finally, the high-frequency enhanced image is obtained through inverse Fourier transform. .
[0027] Through the aforementioned frequency domain mixing enhancement, the model can access training samples with different local high-frequency perturbations, thereby enhancing its adaptability to changes in hair, soil occlusion, lighting changes, pose changes, and local texture instability.
[0028] S5: Generate a target-frequency joint selection score based on the attention score and the high-frequency energy of the corresponding image block, and select a target high-frequency token from the high-frequency image block tokens based on the target-frequency joint selection score; When generating the target-frequency joint selection score, the target-frequency joint token selection module is used. The target-frequency joint token selection module includes target correlation score, high-frequency energy map, high-frequency energy score, joint selection score and target high-frequency token.
[0029] In the original vision branch, category tokens are used to aggregate global identity information, and their attention scores to each image patch token reflect the model's estimation of target relevance at each spatial location. Let... Indicates the first Category token attention score for each image patch. It can be obtained by averaging the attention from category tokens to image patch tokens from multiple attention heads in the last Transformer layer, or by weighted fusion of attention from multiple layers; On the other hand, high-frequency enhanced images Alternatively, the high-pass filter response can be used to calculate the high-frequency energy of each image block. Let... Indicates the first The high-frequency energy of each image patch. In a specific implementation... This represents the mean absolute value of the high-frequency response within the corresponding image patch; in another implementation, This is the squared mean of the high-frequency response; in yet another implementation, This represents the mean amplitude of the corresponding region in the frequency domain amplitude spectrum of the image patch.
[0030] This invention will score the relevance of the target. With high frequency energy The fusion yields the joint selection score. The fusion method can be multiplication fusion. It can also be used for weighted fusion. ,in Weights between 0 and 1 This indicates a normalization operation. Preferably, a two-level screening strategy can be adopted: first, based on... Select the top K target candidate image patches, and then within the candidate set, based on... or Select the top Z target high-frequency tokens.
[0031] This joint selection mechanism satisfies two conditions: first, the selected image patch should be located in the animal's main body or identity discrimination region; second, the image patch should contain obvious high-frequency details. Thus, background areas such as grass, leaves, water ripples, and rocks, which have strong high-frequency energy but low category token attention, are suppressed; large areas of solid color on the animal's body, while potentially attracting high attention, have low high-frequency energy and will not excessively occupy the learning capacity of high-frequency branches.
[0032] S6: Perform feature-level rotation on the target high-frequency token or its corresponding two-dimensional feature map to obtain a rotated target high-frequency token; Feature-level rotation includes target high-frequency feature maps, rotation masks or rotation selection maps, feature-level rotation, rotation target high-frequency tokens, and rotation-consistent mapping. The core of this module is that the rotation is not applied to the original pixel image, nor is it an indiscriminate rotation of all image patch features, but rather applied to the target high-frequency features obtained by joint target-frequency selection.
[0033] Specifically, the target high-frequency token can be reconstructed into a two-dimensional feature map based on its original image patch coordinates. If the selected token is sparsely distributed, a sparse feature map with the same grid size as the original image patch can be constructed, with unselected positions filled with zero vectors, learnable mask vectors, or corresponding original high-frequency features. Subsequently, a rotation angle is applied to this two-dimensional feature map. , You can choose from the preset set {-15°,-10°,-5°,5°,10°,15°}, or from the continuous interval [- ] . max, Random sampling within [max].
[0034] Two-dimensional rotation can be represented as: .in( , ) represents the coordinates in the high-frequency feature map of the target. , The coordinates are the rotated coordinates. The rotation transformation can be implemented using nearest neighbor interpolation, bilinear interpolation, or a differentiable grid. The rotated feature map is flattened back into a token sequence, concatenated with the class token, and then input into subsequent Transformer layers to obtain the high-frequency global features of the rotated target.
[0035] Because the rotation occurs at the feature layer rather than the image pixel layer, this invention avoids target cropping, background filling, and loss of local details caused by image-level rotation. Simultaneously, since the rotation object is the target's high-frequency token or target's high-frequency feature map, this invention reduces the risk of rotational enhancement of high-frequency background noise, allowing rotation robustness learning to focus on textures, spots, stripes, and contour regions that truly contribute to identity recognition.
[0036] S7: Based on the original global features, high-frequency global features, and high-frequency features of the rotated target, a joint loss constraint, individual identity classification constraint, metric learning constraint, feature balance constraint, and rotation consistency high-frequency constraint are applied to train a wildlife re-identification model. The joint loss constraints include identity classification loss, triplet loss, and total loss. The global features output by the original visual branch are... The global characteristics of the high-frequency enhanced branch output are The global feature of the high-frequency branch output of the r-th rotating target is The identity classification loss is used to constrain each global feature to correctly predict the identity of an animal individual; the triplet loss is used to constrain the distance between features of the same individual to be less than the distance between features of different individuals.
[0037] The basic re-identification loss can be expressed as:
[0038] Feature equalization loss is used to constrain the original visual token features at the selected location. High-frequency token characteristics The difference between them. The loss can be in the form of Smooth L1: a quadratic penalty is used when the absolute value of the difference is less than a threshold, and a linear penalty is used when the difference is large, to avoid excessive gradients. This loss allows the high-frequency branches to highlight fine-grained textures without deviating from the visual semantics of the original image.
[0039] Rotation-consistent high-frequency constraints are used to ensure that the high-frequency characteristics of the target remain consistent before and after rotation. Specifically, let... The high-frequency token feature of the target before rotation. This represents the high-frequency token feature of the target after rotation. It is achieved through inverse rotation or coordinate index mapping. Restore to the original direction coordinates, and obtain and minimize and The difference between them. This constraint can be expressed as: .
[0040] In one embodiment, the total loss is:
[0041] in For characteristic equalization loss, For global rotation-invariant constraints, For rotationally consistent high-frequency constraints, , and The corresponding loss weights. It can be represented as or This is used to constrain the consistency between the global features of the rotation branch and the original or high-frequency global features.
[0042] S8: Use the trained wildlife re-identification model to extract re-identification features between the image to be retrieved and the image in the library, and obtain the retrieval results for the same individual based on the feature distance.
[0043] During the inference phase, after inputting the image to be retrieved, the model performs feature extraction to obtain re-identification features for retrieval. To reduce deployment overhead, only the category token global features of the original visual branch can be used; alternatively, the global features of the original visual branch can be concatenated, weighted, summed, or normalized and fused with the global features of the high-frequency branch. Subsequently, distance calculation is performed on the features of the query image and the library images, and the ranking results are output based on the distance.
[0044] When deployed in nature reserves, feature vectors can be pre-calculated and stored for each image in the library. When a new query image is input, only the query features need to be calculated and their similarity with the library features to obtain candidate results for the same individual.
[0045] Example: Parameter settings: The input image size is set to 256×256, and the image patch size is 16×16, therefore each image contains 16×16=256 image patch tokens. The visual transformer embedding dimension D can be set to 384, 768, or 1024. The target candidate ratio K / N can be set to 0.6 to 0.8, and the target high-frequency token selection ratio Z / N can be set to 0.3 to 0.6. The frequency domain mixing mask ratio α can be randomly sampled between 0 and 0.5. The feature-level rotation angle can be sampled between -15° and 15°. The training batch can contain 8 identities, with 4 images for each identity. The optimizer can use SGD or AdamW, and the learning rate uses cosine decay.
[0046] The parameters mentioned above are for illustrative purposes only. For animals with prominent stripes or spots, such as tigers, zebras, and seals, the proportion of high-frequency tokens can be appropriately increased; for animals that rely mainly on contour and edge differences for identification, such as elephants and sharks, the high-frequency weight of the contour region can be appropriately increased; for datasets with large changes in pose orientation, the feature-level rotation angle range or the number of rotation samples can be appropriately increased.
[0047] Applicable scenarios: This invention can be applied to various wildlife re-identification scenarios, including but not limited to: giant panda individual identification, tiger and leopard individual identification, zebra individual identification, giraffe individual identification, seal individual identification, elephant individual identification, shark individual identification, and bird individual identification. This method is particularly suitable for the following situations: animal individual differences are mainly reflected in texture, spots, stripes, or contours; the image background is complex and contains a large amount of high-frequency noise; there are significant changes in animal posture, orientation, or camera perspective; the training data involves multiple species or there are domain differences between the test species and the training species.
[0048] Optional implementation methods and equivalent replacements: Without altering the core technical concept of this invention, the following equivalent substitutions can be adopted: First, the visual transformer backbone network can be replaced with a Swing Transformer, DeiT, TransReID backbone, hybrid CNN-Transformer backbone, or other neural networks with token attention mechanisms. Second, the high-pass filter can be replaced with a fixed filter or a learnable frequency domain filter. Third, the target-frequency joint selection score can be implemented by multiplicative fusion, weighted fusion, multilayer perceptron fusion, or gated fusion. Fourth, feature-level rotation can be replaced with affine transformation, scaling transformation, flipping transformation, or a combination of rotation and translation transformation. Fifth, rotation-consistent high-frequency constraints can be implemented using Smooth L1, L2, cosine distance, contrast loss, or KL divergence. Sixth, during the inference stage, single-branch features, dual-branch fusion features, or multi-scale fusion features can be selected according to the real-time requirements of the application.
[0049] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A rotation-consistent target perception method for high-frequency wildlife re-identification, characterized in that: Includes the following steps: S1: Obtain images of the wild animals to be trained and their individual identification labels; S2: Construct the original visual branch, input the wildlife image into the first visual transformer branch, and obtain the original image patch token, the category token, and the attention score of the category token relative to each original image patch token; S3: Construct a frequency domain hybrid high-frequency enhancement branch, perform Fourier transform on the wildlife image and obtain high-frequency components through high-pass filtering, perform frequency domain hybridization of the high-frequency components with the original frequency domain representation of the wildlife image, and obtain a high-frequency enhanced image through inverse Fourier transform; S4: Perform target-frequency joint token selection, input the high-frequency enhanced image into the second visual transformer branch to obtain high-frequency image block tokens; S5: Perform target high-frequency feature level rotation, generate target-frequency joint selection score based on the attention score and the high-frequency energy of the corresponding image block, and select target high-frequency tokens from the high-frequency image block tokens based on the target-frequency joint selection score; S6: Construct a joint loss function, perform feature-level rotation on the target high-frequency token or its corresponding two-dimensional feature map to obtain the rotated target high-frequency token, and perform individual identity classification constraints, metric learning constraints, feature balance constraints and rotation consistency high-frequency constraints based on the original global features, high-frequency global features and rotated target high-frequency features to train a wildlife re-identification model; S7: Train the wildlife re-identification model by optimizing the parameters of the visual transformer, projection layer, classification layer and related token selection module through backpropagation, so that the model learns re-identification features that have both high-frequency target discrimination ability and rotation robustness. S8: Perform inference retrieval, use the trained wildlife re-identification model to extract re-identification features of the image to be retrieved and the image in the library, and obtain the retrieval results of the same individual based on the feature distance.
2. The high-frequency wildlife re-identification method for rotationally consistent target perception according to claim 1, characterized in that: The frequency domain mixing in step S3 includes: converting the input image into a single-channel image and then performing a two-dimensional Fourier transform to obtain the original frequency domain representation; using a Gaussian high-pass filter to retain the high-frequency components in the original frequency domain representation; constructing a random mask matrix with the same size as the original frequency domain representation, and locally mixing the high-frequency components and the original frequency domain representation according to the random mask matrix.
3. The rotation-consistent target perception high-frequency wildlife re-identification method according to claim 1, characterized in that: In step S5, the high-frequency energy is determined by at least one of the following: the mean absolute value of the corresponding image block in the high-frequency enhanced image, the mean square value, the mean frequency domain amplitude, or the mean high-pass filter response.
4. The rotation-consistent target perception high-frequency wildlife re-identification method according to claim 1, characterized in that: In step S4, the target-frequency joint selection score is either the product of the attention score and the normalized high-frequency energy, or a weighted sum of the attention score and the normalized high-frequency energy.
5. The rotation-consistent target perception high-frequency wildlife re-identification method according to claim 1, characterized in that: The target-frequency joint selection score in step S4 includes two levels of screening: first, a set of target candidate tokens is selected based on the attention score, and then a set of target high-frequency tokens is selected within the set of target candidate tokens based on the high-frequency energy or the target-frequency joint selection score.
6. The rotation-consistent target perception high-frequency wildlife re-identification method according to claim 1, characterized in that: The feature-level rotation in step S5 includes: restoring the selected target high-frequency tokens to a two-dimensional feature map or a sparse feature map according to their image block coordinates; applying at least one preset angle or random angle rotation transformation in the two-dimensional feature map coordinate system; flattening the rotated two-dimensional feature map back into a token sequence and concatenating it with the category tokens before inputting it into the visual transformer layer.
7. The high-frequency wildlife re-identification method for rotationally consistent target perception according to claim 1, characterized in that: The rotation-consistent high-frequency constraint in step S6 includes: restoring the features corresponding to the high-frequency token of the rotation target to the original direction coordinates through inverse rotation or index mapping, and constraining the difference between the restored high-frequency features of the rotation target and the high-frequency features of the target before rotation.
8. The rotation-consistent target perception high-frequency wildlife re-identification method according to claim 1, characterized in that: In step S6, the feature equalization constraint is used to constrain the distance between the original visual token feature corresponding to the target high-frequency token position in the original image branch and the target high-frequency token feature in the high-frequency branch.
9. The rotation-consistent target perception high-frequency wildlife re-identification method according to claim 1, characterized in that: Step S8 includes a training phase and an inference phase. The training phase uses the original visual branch, the high-frequency enhancement branch, and the high-frequency branch of the rotated target for joint optimization. The inference phase uses only the global features of the original visual branch, or uses the fusion features of the global features of the original visual branch and the global features of the high-frequency branch for retrieval.
