Bovine face recognition method based on double-flow feature fusion and semantic quality valve adjusting framework

CN122821591APending Publication Date: 2026-09-25INNER MONGOLIA UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611020325.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-09
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

[0005]第一,面部非平面特性与姿态干扰:牛脸具有显著的非平面几何特性,当牛只发生低头、侧头等剧烈姿态变化时,传统算法提取的局部特征极易失真,导致识别失效

Benefits of technology

[0033]本发明通过判别式与全局特征融合模块DGFM,将牛脸局部细粒度判别特征与全局语义特征进行融合,能够减少单一局部纹理特征在姿态变化、遮挡或复杂背景下产生的识别偏差。通过设置语义质量阀模块SQV,对全局语义分支的可靠性进行评估和调节,能够降低强光、遮挡、污损或运动模糊等因素对语义表征的影响。通过设置查询级自适应权重调节模块QAAM,根据最高相似度得分与次高相似度得分之间的间隔动态生成权重系数,使不同识别难度的样本能够采用不同的局部特征与全局语义特征融合比例,从而提高复杂牧场场景下牛脸身份识别的准确性和稳定性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122821591A_ABST
    Figure CN122821591A_ABST
Patent Text Reader

Abstract

The application provides a kind of based on double-flow feature fusion and semantic quality valve adjustment framework's cow face recognition method, the cow face recognition method includes the following steps: the local feature of inputting cow image is extracted using EdgeFace encoder, while global feature is modeled using CLIP image encoder, then the local feature and the global feature are projected to the unified mixed feature interaction space for cross-modal alignment;The similarity score of query sample and database sample in local and global space is calculated respectively, by calculating the similarity interval between the highest and the second highest similarity score of the query sample in the identity library, the similarity interval is nonlinearly weighted to generate dynamic weight coefficient.The cow face recognition method of the application can effectively correct the expression deviation of local feature under complex background or posture change compared with traditional recognition method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of livestock monitoring and computer vision recognition. Specifically, it relates to a cow face recognition method based on a dual-stream feature fusion and semantic quality valve adjustment framework, as well as a cow face recognition system, a computer-readable storage medium, and a computer device corresponding to this method. Background Technology

[0002] With the rapid development of smart animal husbandry, automated and information-based precise monitoring of cattle has become a core requirement for improving farm management efficiency. Individual cattle identification, as a prerequisite for precise feeding, health early warning, and digital asset management, has evolved from contact-based to contactless technologies.

[0003] Traditional identification methods mainly rely on RFID electronic ear tags. However, in real pasture environments, ear tags have inherent drawbacks such as high detachment rates, susceptibility to soiling, and increased stress on cattle.

[0004] In recent years, deep learning-based cow face recognition technology has become a research hotspot due to its advantages of being contactless and low-cost. However, in practical applications, the following technical bottlenecks still exist:

[0005] First, the non-planar characteristics of the face and posture interference: the cow's face has significant non-planar geometric characteristics. When the cow undergoes drastic posture changes such as lowering its head or turning its head, the local features extracted by traditional algorithms are easily distorted, leading to recognition failure.

[0006] Second, the environmental noise is complex: strong light reflection, fence shadows, and mud cover in the outdoor environment of the ranch will generate a lot of visual noise, which will interfere with the stability of discriminative features.

[0007] Third, the feature fusion strategy is simplistic: most existing algorithms use fixed weighting or simple stacking methods to fuse features, which cannot dynamically adjust for differences in image quality. When faced with cows that are highly similar in appearance (long-tailed distribution scenarios), the system often lacks sufficient global constraints to correct local ambiguities, making it difficult to achieve Top-1 accuracy to meet industrial deployment requirements.

[0008] In view of this, the present invention is hereby proposed. Summary of the Invention

[0009] In view of this, the present invention discloses a cow face recognition method based on a dual-stream feature fusion and semantic quality valve adjustment framework. This method, with a discriminative and global feature fusion module (DGFM), a semantic quality valve module (SQV), and a query-level adaptive weight adjustment module (QAAM) as its core, can dynamically adjust the recognition criteria for complex backgrounds, pose changes, and image quality fluctuations compared to traditional recognition methods, thereby improving the accuracy and stability of cow face identification.

[0010] Specifically, the present invention is achieved through the following technical solutions:

[0011] In a first aspect, the present invention provides a cow face recognition method based on a dual-stream feature fusion and semantic quality valve adjustment framework, comprising the following steps:

[0012] Local features are extracted from the input cattle image using the EdgeFace encoder, while global features are modeled using the CLIP image encoder. The local features and global features are then projected into a unified hybrid feature interaction space for cross-modal alignment.

[0013] The similarity scores of the query sample and the database sample in the local and global spaces are calculated respectively. By calculating the similarity interval between the highest and second highest similarity scores of the query sample in the identity database, the similarity interval is non-linearly weighted to generate dynamic weight coefficients.

[0014] The final fusion matching score is used to achieve complementary enhancement of multi-scale information.

[0015] Specifically, the implementation steps of this method are as follows:

[0016] Cow face feature interaction stage:

[0017] 1) The fine-tuned EdgeFace encoder is used to perform deep convolution operations on the input image, focusing on extracting fine-grained biological discriminative features of the cow's face region, covering skin texture, relative positions of facial features, and key identity feature points. At the same time, the pre-trained CLIP image encoder is used in parallel to model global semantic features at a macro scale, capturing semantic contextual information including the overall outline of the cow, the distribution of body color style, and the background of the pasture environment. A dual-stream parallel architecture is used to achieve comprehensive coverage from fine-tuning discriminative power to generalized semantic representation.

[0018] 2) Through the Discriminant and Global Feature Fusion (DGFM) module, the local features and global semantic features located in different scales and feature distribution spaces are projected into a unified hybrid feature interaction space. This step uses linear or nonlinear transformations to eliminate the representational gap between heterogeneous features and ensures that the two types of features are effectively complementary in the semantic dimension through cross-modal alignment. This leverages the breadth of global semantics to enhance the system's representation accuracy in low-resolution, drastically changing pose, or long-tailed distribution scenarios.

[0019] 3) A Semantic Quality Valve (SQV) is introduced to dynamically monitor the signal stability of the global semantic branch. This module analyzes the distribution consistency or confidence index of feature vectors to identify and evaluate negative interferences in the real-world ranch environment (such as strong light fluctuations, background clutter occlusion, motion blur, etc.) in real time. Based on this, a reliability gating factor is calculated to implement multiplicative weight correction, which acts like an "information filter" to accurately suppress unreliable or noisy semantic signals, and finally outputs a highly purified composite interactive feature representation.

[0020] B. Identity Verification Stage:

[0021] The system calculates the similarity scores between the query sample and the database sample in the local and global spaces, respectively, and calls the Query-Level Adaptive Weight Adjustment (QAAM) module. Based on the interval between the highest and second-highest candidate similarity scores, it dynamically judges the sample identification difficulty and uses the Sigmoid mapping function to adaptively allocate weight coefficients, so that easy samples focus on local accurate discrimination and difficult samples tend to global semantic correction. Finally, it achieves accurate cattle identification decision through weighted fusion of comprehensive matching scores.

[0022] More preferably, the module used in the cow face feature interaction stage employs a dual-stream parallel architecture, utilizing a finely tuned... The encoder extracts highly discriminative local fine-grained features of the cow's face. Simultaneously utilize pre-trained Image encoders model global semantic features with generalization capabilities. ; The aforementioned local discriminative cues in different scales and distribution spaces are projected onto a unified hybrid feature interaction space along with large-scale scene semantics. Cross-modal alignment is used to eliminate the expression gap between heterogeneous features, and the complementary enhancement of multi-scale information is achieved based on the final fusion matching score. In this way, global semantic constraints are used to correct the expression bias of local features under complex backgrounds or pose changes.

[0023] More preferably, the query-level adaptive weight adjustment module used in the identity recognition stage ( This module calculates the interval between the highest and second-highest similarity scores between the query sample and its match in the identity database. To perceive the difficulty of sample identification and utilize the weight mapping formula Dynamically generate weight coefficients, where for Activation function To adjust the slope coefficient of the mapping sensitivity, A confidence threshold for distinguishing between easy and difficult samples; The module scores the local matching based on this coefficient. Matching score with global score Conduct "one Figure 1 The weighted fusion decision-making of the "strategy" means that for easy samples with clear features, the local discrimination weight is automatically enhanced to improve accuracy, while for difficult samples with occlusion or extreme poses, the contribution ratio of global semantic features is automatically increased, thereby playing a semantic correction role and ensuring the recognition stability of the system in complex poses and long-tail distribution scenarios.

[0024] More preferably, the above-mentioned highest similarity score Second highest similarity score The difference is used to obtain the similarity interval. As a benchmark for verifying the difficulty of sample identification;

[0025] The module performs real-time validation of input samples using the above formula: if the validation results show a large similarity interval (i.e., easy samples), it adaptively assigns samples with higher similarity. Values ​​to enhance local discriminative features The decision weights are adjusted; if the validation interval is narrow (i.e., difficult samples), the weights are automatically reduced. Values ​​to enhance global semantic features The contribution ratio is determined by introducing global semantic constraints to correct potential discrimination biases caused by local features in complex environments, and finally based on the formula. Output the optimal identity recognition result after adaptive verification.

[0026] Secondly, this invention discloses a cow face recognition system based on a dual-stream feature fusion and semantic quality valve adjustment framework, comprising:

[0027] Cow face feature interaction module: Used to extract local features from input cow images using EdgeFace encoder, model global features using CLIP image encoder, and then project the local features and global features into a unified hybrid feature interaction space for cross-modal alignment;

[0028] Identity recognition module: Calculates the similarity scores of the query sample and the database sample in the local and global spaces respectively. By calculating the similarity interval between the highest and second highest similarity scores of the query sample in the identity database, the similarity interval is non-linearly weighted to generate dynamic weight coefficients.

[0029] Complementary enhancement module: used to achieve complementary enhancement of multi-scale information based on the final fusion matching score.

[0030] Thirdly, the present invention discloses a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the cow face recognition method as described in the first aspect.

[0031] Fourthly, the present invention discloses a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the cow face recognition method as described in the first aspect.

[0032] Compared with the prior art, the solution of the present invention has the following beneficial effects:

[0033] This invention utilizes a discriminative and global feature fusion module (DGFM) to fuse fine-grained local discriminative features of cow faces with global semantic features, reducing recognition bias caused by single local texture features in situations involving pose changes, occlusion, or complex backgrounds. By setting a semantic quality valve module (SQV), the reliability of the global semantic branch is evaluated and adjusted, reducing the impact of factors such as strong light, occlusion, dirt, or motion blur on semantic representation. Furthermore, by setting a query-level adaptive weight adjustment module (QAAM), weight coefficients are dynamically generated based on the interval between the highest and second-highest similarity scores, allowing samples with varying recognition difficulties to employ different ratios of fusion between local and global semantic features, thereby improving the accuracy and stability of cow face identification in complex pasture scenarios.

[0034] Furthermore, this invention utilizes a pre-trained CLIP image encoder to extract global semantic features and combines it with a finely tuned EdgeFace encoder to extract local discriminative features, achieving cow face identification without relying on a single feature source. This dual-stream feature structure enhances the model's adaptability to different acquisition environments and cow postures, and helps reduce maintenance costs during subsequent identity database expansion and ranch deployment. Attached Figure Description

[0035] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0036] Figure 1 This is a block diagram of the overall algorithm structure for dual-stream feature fusion and semantic quality valve adjustment in an embodiment of the present invention.

[0037] Figure 2 This is a logic block diagram of the query-level adaptive Alpha feature fusion algorithm based on re-identification according to an embodiment of the present invention;

[0038] Figure 3 This is a schematic diagram of an adaptive recognition network combining global and local features according to an embodiment of the present invention;

[0039] Figure 4This is a joint constraint diagram of the cattle re-identification loss function according to an embodiment of the present invention;

[0040] Figure 5 This is a schematic diagram illustrating the matching stability of the same cow face samples under different feature fusion strategies in an embodiment of the present invention.

[0041] Figure 6 The above are visualization results of cow face heatmaps under different feature fusion strategies in embodiments of the present invention.

[0042] Figure 7 This is a schematic diagram of cow face detection and identification number labeling in a complex pasture scenario according to an embodiment of the present invention;

[0043] Figure 8 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation

[0044] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0045] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.

[0046] It should be understood that although the terms first, second, third, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0047] Example

[0048] This invention provides a cow face recognition method based on a dual-stream feature fusion and semantic quality valve adjustment framework, such as... Figures 1 to 8 As shown, where Figure 1 The overall algorithm structure is shown. Figure 2This illustrates the weight adjustment logic of QAAM. Figure 3 This demonstrates an adaptive recognition network that combines DGFM, SQV, and QAAM. Figures 4 to 6 These are used to illustrate the joint constraints of the loss function for cattle re-identification, the stability of matching identical cattle face samples, and the visualization results of cattle face heatmaps under different feature fusion strategies. Figure 7 This shows the results of cow face detection and identification number labeling in a complex pasture scenario. Figure 8 The computer device structure for implementing this method is shown, including the following steps:

[0049] Local features are extracted from the input cattle image using the EdgeFace encoder, while global features are modeled using the CLIP image encoder. The local features and global features are then projected into a unified hybrid feature interaction space for cross-modal alignment.

[0050] The similarity scores of the query sample and the database sample in the local and global spaces are calculated respectively. By calculating the similarity interval between the highest and second highest similarity scores of the query sample in the identity database, the similarity interval is non-linearly weighted to generate dynamic weight coefficients.

[0051] The final fusion matching score is used to achieve complementary enhancement of multi-scale information.

[0052] This invention addresses the challenges of low recognition accuracy caused by the complex and variable environment of pasture farming and the non-planar nature of cow faces. It proposes a cow face recognition method based on the EF-CattleNet framework. This method utilizes the Ubuntu deep learning experimental platform, employing an NVIDIA GeForce RTX 5090 GPU with 24GB of VRAM, and is built using the PyTorch 2.1 framework. The experimental dataset originates from video streams of 1360 adult cows collected in March 2025 at the Outai Ranch in Hohhot, Inner Mongolia. Frame segmentation and similar image removal were performed using OpenCV, followed by data augmentation techniques such as rotation, mirroring, and adding salt-and-pepper noise, resulting in a large-scale training set of 54,400 images. To further verify the algorithm's generalization ability, 9928 augmented images of 100 Holstein cows were introduced as an independent test set. The model performance was comprehensively evaluated using accuracy (Acc), computational complexity (GFLOPs), and real-time performance (FPS).

[0053] In the specific algorithm implementation process, the first step is the interaction stage of cow face features. For example... Figure 1 and Figure 3As shown, the system initiates the Discriminative and Global Feature Fusion (DGFM) module through a dual-stream parallel architecture. One side utilizes a finely tuned EdgeFace-S encoder to extract fine-grained biological discriminative features of the cow's face region, such as skin texture and the relative positions of facial features. The other side simultaneously uses a pre-trained CLIP image encoder to model global semantic features at a macro scale, capturing the overall outline of the cow, its body color style, and the environmental background. Through linear mapping transformation, these two heterogeneous features, located in different dimensions and distribution spaces, are projected onto a unified hybrid feature interaction space for cross-modal alignment. This leverages the breadth of global semantics to correct the expression bias of local features in low-resolution or drastically changing pose scenarios. Simultaneously, the Semantic Quality Valve (SQV) monitors signal stability in real time, identifies negative interferences such as strong light and occlusion by analyzing feature distribution consistency, and calculates a reliability factor for weight correction.

[0054] Then comes the identity recognition and decision-making stage, such as Figure 2 As shown, the system introduces a Query-Level Adaptive Weight Adjustment (QAAM) module. This module dynamically senses the identification difficulty of the current sample by calculating the interval between the highest and second-highest similarity scores in the identity database. For "difficult samples" that are more difficult to identify, the module automatically assigns weights using the Sigmoid mapping function, making it more inclined to rely on global semantics for correction; while for clear "easy samples," it focuses on local accurate discrimination. Finally, the system combines the dynamic weights generated by QAAM with the correction factor of SQV, and obtains a comprehensive matching score through a weighted fusion formula to achieve accurate cattle identification. Experimental data show that EF-CattleNet significantly improves the recognition accuracy while ensuring real-time performance, and still exhibits strong robustness and generalization performance even in complex pasture environments with visual noise.

[0055] A. Cow face feature interaction stage:

[0056] The core of this stage lies in achieving the extraction and initial interaction of heterogeneous features through a dual-stream parallel architecture. First, the system initiates the discriminative and global feature fusion module (…). (The image of the cow's face to be identified) Two parallel feature extraction branches are input simultaneously. In the local discriminative stream, the fine-tuned... encoder Capture fine-grained biometric features of a cow's face, such as nasal texture and the relative positions of facial features, to generate local discriminative feature representations:

[0057] ;

[0058] Meanwhile, in the global semantic stream, pre-trained [data / methods] are utilized in parallel. Image encoder Modeling global semantic features at a macroscopic scale captures contextual information such as the overall outline of cattle, body color distribution, and pasture background, generating global semantic feature representations:

[0059] ;

[0060] After extraction, The module utilizes linear mapping transformations to transform data in spaces with different dimensions and distributions. and Projected onto a unified hybrid feature interaction space. Cross-modal alignment eliminates the representational gap between heterogeneous features, ensuring semantic complementarity between the two types of features. Subsequently, the system introduces a semantic quality valve ( This module dynamically monitors the signal stability of the global semantic branch. It assesses negative disturbances in the pasture environment (such as strong light fluctuations, occlusion, or motion blur) by analyzing the distribution consistency of feature vectors, and calculates the reliability gating factor accordingly. The global semantic score is adjusted using a multiplicative weighting of this factor, and the adjustment logic is as follows:

[0061]

[0062] in, To initially assign weights, These are the corrected weights after reliability verification. This mechanism acts like an "information filter," accurately suppressing unreliable semantic signals caused by environmental noise. By utilizing purified global semantic constraints, it corrects the expression bias of local features under complex backgrounds or pose changes, laying a robust feature foundation for subsequent accurate recognition.

[0063] B. Identity verification stage:

[0064] The core of this stage lies in achieving accurate cattle classification through a dynamic decision-making mechanism, ensuring that the system maintains high accuracy for input images of varying quality in complex pasture environments.

[0065] First, the system introduces a query-level adaptive weight adjustment module ( ), by sensing the sample to be retrieved The system dynamically assigns feature weights based on the difficulty of recognition. In practice, the system first calculates the local discriminative features separately. With global semantic features Candidate samples in the identity database The cosine similarity is used to obtain the local matching score. Matching score with global score .

[0066] In order to achieve "one Figure 1 The weighting of "strategy" The module calculates the interval between the highest and second-highest similarity scores between the query sample and its match in the identity database. To perceive the difficulty of sample identification. When the interval... When the weights are small, it indicates that the current sample is ambiguous or severely affected by environmental interference (i.e., a "difficult sample"). In this case, the system automatically adjusts the weight coefficients using the weight mapping formula. :

[0067]

[0068] in, for Activation function This is the sensitivity coefficient to changes in weight. This is the preset confidence threshold.

[0069] Table 1 Ablation Experiment

[0070]

[0071] Based on the data verification in Table 1 (ablation experiment), after introducing the QAAM module, the system's recognition accuracy for "difficult samples" such as occlusion and strong light significantly improved from 86.45% to 92.12%, indicating that query-level adaptive weight adjustment can improve the insufficient expression of single features in complex scenes. Finally, the system combines the reliability factor corrected by the SQV module with the dynamic weights generated by QAAM to calculate the final fusion matching score. :

[0072] ;

[0073] Table 2 Comparison results of different models

[0074]

[0075] As shown in Table 2 above (comparison of different models), the framework based on dual-stream feature fusion and semantic quality valve adjustment proposed in this embodiment of the invention achieves a final recognition accuracy (Acc) of 98.50% with all modules enabled. Regarding real-time performance, despite the introduction of a dual-stream interaction mechanism, the model computation is only 2.3 GFLOPs, and the inference speed remains at 45.0 FPS, significantly outperforming mainstream models such as ResNet-50 (35.6 FPS) and Vision Transformer (12.4 FPS), achieving a balance between high-precision recognition and the real-time monitoring requirements of pastures. Furthermore, by optimizing the feature distribution, the Euclidean distance between feature vectors of identical cow faces is reduced to 0.40, while the distance between different cow faces increases to 1.80, enhancing inter-class discriminability.

[0076] Referring to the accompanying drawings in the instruction manual Figures 4 to 6 This allows for an explanation of the training constraints and recognition effects of the present invention. Among other things, Figure 4 This is used to illustrate the joint constraint relationship of different loss functions on the feature space during the cattle re-identification process. Figure 5 This is used to demonstrate the matching stability of the same cow face samples under different feature fusion strategies. Figure 6 This invention is used to demonstrate the visualization results of cow face heatmaps under different feature fusion strategies. The accompanying figures illustrate that this invention, through the fusion of local discriminative features and global semantic features, combined with semantic quality valve adjustment and query-level adaptive weight allocation, helps improve the stability and discriminative power of cow face recognition results in complex scenarios.

[0077] like Figure 7 As shown, in complex pasture scenarios, cattle images may be affected by factors such as pose changes, partial occlusion, illumination variations, and background interference. This invention adjusts the reliability of the global semantic branch through a semantic quality valve and dynamically adjusts the fusion weights based on the similarity interval between the query sample and candidate samples in the identity database through a query-level adaptive weight adjustment module, thereby improving the accuracy and robustness of cattle face recognition results in practical application scenarios.

[0078] This invention provides a cow face recognition method based on a dual-stream feature fusion and semantic quality valve adjustment framework, and also provides a cow face recognition system corresponding to the method. The system's module division and... Figures 1 to 3 The corresponding algorithm framework includes an image preprocessing module, a discriminative and global feature fusion module (DGFM), a semantic quality valve module (SQV), a query-level adaptive weight adjustment module (QAAM), and an identity recognition output module.

[0079] The image preprocessing module is used to acquire images of cattle to be identified, and to perform cattle face region localization, scale normalization and image enhancement processing on the images of cattle to be identified in order to obtain query sample images.

[0080] The Discriminative and Global Feature Fusion Module (DGFM) is used to extract fine-grained discriminative features of the cow face using the EdgeFace encoder and extract global semantic features using the CLIP image encoder. The two types of features are then projected into a unified hybrid feature interaction space for dual-stream feature alignment and fusion.

[0081] The Semantic Quality Valve (SQV) module is used to evaluate the reliability of global semantic features based on the distribution consistency of global semantic features, image confidence, or semantic branch stability, and adjust the degree to which global semantic features participate in subsequent fusion recognition based on the evaluation results.

[0082] The Query-Level Adaptive Weight Adjustment (QAAM) module generates dynamic weight coefficients based on the similarity interval between the highest and second-highest similarity scores of the query sample in the identity database.

[0083] The identity recognition output module is used to calculate the final fusion matching score based on the dynamic weight coefficient, local matching score and global matching score, and output the cattle identity recognition result.

[0084] Figure 8 This is a schematic diagram of the structure of a computer device disclosed in this invention. (Reference) Figure 8 As shown, the computer device includes: an input device 63, an output device 64, a memory 62, and a processor 61; the memory 62 is used to store one or more programs; when the one or more programs are executed by the one or more processors 61, the one or more processors 61 implement a cow face recognition method as provided in the above embodiment; wherein the input device 63, the output device 64, the memory 62, and the processor 61 can be connected via a bus or other means. Figure 8 Taking the example of a connection between China and Israel via a bus.

[0085] The memory 62, as a read / write storage medium for a computing device, can be used to store software programs and computer-executable programs, such as the program instructions corresponding to the cow face recognition method described in this application embodiment. The memory 62 may mainly include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the device. Furthermore, the memory 62 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 62 may further include memory remotely located relative to the processor 61, and these remote memories can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0086] The input device 63 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the device; the output device 64 may include display devices such as a display screen.

[0087] The processor 61 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory 62.

[0088] This application embodiment also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the cow face recognition method provided in the above embodiments. The storage medium can be any type of memory device or storage device, including: mounting media, such as CD-ROM, floppy disk, or magnetic tape devices; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements; the storage medium may also include other types of memory or combinations thereof; furthermore, the storage medium may be located in a first computer system in which the program is executed, or it may be located in a different second computer system connected to the first computer system via a network (such as the Internet); the second computer system can provide program instructions to the first computer for execution. The storage medium includes two or more storage media that can reside in different locations (e.g., in different computer systems connected via a network). The storage medium can store program instructions (e.g., specifically implemented as a computer program) executable by one or more processors.

[0089] Finally, it should be noted that although this specification contains many specific implementation details, these should not be construed as limiting the scope of any invention or the scope of the claims, but rather are primarily used to describe the features of specific embodiments of a particular invention. Certain features described in the various embodiments of this specification may also be implemented in combination in a single embodiment. On the other hand, various features described in a single embodiment may also be implemented separately in various embodiments or in any suitable sub-combination. Furthermore, while features may function in certain combinations as described above and even initially claimed in this way, one or more features from a claimed combination may be removed from that combination in some cases, and a claimed combination may refer to a sub-combination or a variation of a sub-combination.

[0090] Similarly, although the operations are depicted in a specific order in the accompanying drawings, this should not be construed as requiring these operations to be performed in the specific order shown or sequentially, or requiring all illustrated operations to be performed to achieve the desired result. In some cases, multitasking and parallel processing may be advantageous. Furthermore, the separation of various system modules and components in the above embodiments should not be construed as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.

[0091] Thus, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims may be performed in a different order and still achieve the desired result. Furthermore, the processes depicted in the drawings are not necessarily shown in a specific order or sequence to achieve the desired result. In some implementations, multitasking and parallel processing may be advantageous.

[0092] The above description is merely a preferred embodiment of this disclosure and is not intended to limit this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A cow face recognition method based on a dual-stream feature fusion and semantic quality valve adjustment framework, characterized in that, Includes the following steps: Acquire images of cattle to be identified, and perform cattle face region localization, scale normalization, and image enhancement processing on the images of cattle to be identified to obtain query sample images; The query sample image is input into the discriminant and global feature fusion module DGFM. The EdgeFace encoder is used to extract local fine-grained discriminant features of the cow face, and the CLIP image encoder is used to extract global semantic features. The local fine-grained discriminant features and the global semantic features are projected into a unified hybrid feature interaction space to complete the dual-stream feature alignment and fusion. The global semantic features are input into the semantic quality valve module (SQV). The reliability of the global semantic features is evaluated based on feature distribution consistency, image confidence, or semantic branch stability. The degree to which the global semantic features participate in subsequent fusion recognition is adjusted according to the evaluation results to reduce the impact of occlusion, strong light, dirt, or motion blur on the global semantic representation. Calculate the local matching score and global matching score of the query sample and the identity database sample in the local feature space and global semantic space, respectively, and input the local matching score and the global matching score after SQV correction into the query-level adaptive weight adjustment module QAAM. The QAAM is used to calculate the similarity interval between the highest and second-highest similarity scores of the query sample in the identity database. Based on the similarity interval, a dynamic weight coefficient is generated through nonlinear mapping. This enhances the weight of local fine-grained discriminative features for easily identifiable samples and enhances the corrective effect of global semantic features for difficult-to-identify samples. The final fusion matching score is calculated based on the dynamic weight coefficient, local matching score, and global matching score. The cattle identity recognition result is then output based on the final fusion matching score.

2. The cow face recognition method according to claim 1, characterized in that, The method of extracting local features using the EdgeFace encoder is to extract highly discriminative, fine-grained local features of a cow's face. The method of modeling global features using the CLIP image encoder is based on pre-trained... Image encoders model global semantic features with generalization capabilities. .

3. The cow face recognition method according to claim 1, characterized in that, The cross-modal alignment method includes projecting the features located in different dimensions and distribution spaces onto a unified hybrid feature interaction space, thereby eliminating the expression gap between heterogeneous features through cross-modal alignment.

4. The cow face recognition method according to claim 1, characterized in that, The similarity interval is calculated by setting the highest similarity score after matching. Second highest similarity score The difference, to obtain As a benchmark for the difficulty of sample identification.

5. The cow face recognition method according to any one of claims 1-4, characterized in that, The formula for the dynamic weighting coefficient is as follows: , for Activation function The sensitivity coefficient, The confidence threshold is used to calculate the local matching score through the aforementioned weighting coefficients. Matching score with global score Weighted fusion.

6. The cow face recognition method according to claim 5, characterized in that, The formula for the final fusion matching score is: .

7. A cow face recognition system based on a dual-stream feature fusion and semantic quality valve adjustment framework, characterized in that, include: The image preprocessing module is used to acquire images of cattle to be identified, and to perform cattle face region localization, scale normalization and image enhancement processing on the images of cattle to be identified. The Discriminative and Global Feature Fusion Module (DGFM) is used to extract fine-grained discriminative features of the cow face using the EdgeFace encoder, extract global semantic features using the CLIP image encoder, and project the two types of features into a unified hybrid feature interaction space for dual-stream feature alignment and fusion. The Semantic Quality Valve (SQV) module is used to evaluate the reliability of global semantic features based on the distribution consistency of global semantic features, image confidence, or semantic branch stability, and adjust the degree to which global semantic features participate in subsequent fusion recognition based on the evaluation results. The Query-Level Adaptive Weight Adjustment (QAAM) module is used to generate dynamic weight coefficients based on the similarity interval between the highest and second-highest similarity scores of the query sample in the identity database. The identity recognition output module is used to calculate the final fusion matching score based on the dynamic weight coefficient, local matching score and global matching score, and output the cattle identity recognition result.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the cow face recognition method based on the dual-stream feature fusion and semantic quality valve adjustment framework as described in any one of claims 1-6, wherein the steps include at least DGFM dual-stream feature fusion, SQV semantic quality valve adjustment, and QAAM query-level adaptive weight adjustment.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the cow face recognition method based on the dual-stream feature fusion and semantic quality valve adjustment framework as described in any one of claims 1-6, or runs the cow face recognition system as described in claim 7.