Live livestock mortgage risk monitoring method and device based on cattle face recognition and medium
By using the improved Yolov5s model for cattle face recognition in herd management, the problems of low recognition accuracy and difficult supervision in traditional methods have been solved, and precise supervision and automated risk control of live animal mortgages have been achieved, ensuring the security and efficiency of the loan business.
Patent Information
- Application Number
- CN202510655528.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-21
- Publication Date
- 2025-09-23
Smart Images

Figure CN120689128A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a method, device and medium for monitoring the risk of live animal mortgages based on cattle face recognition. Background Art
[0002] Traditional livestock farming has long faced financing challenges, primarily due to the difficulty in confirming and regulating the ownership of live livestock assets. Advances in artificial intelligence (AI) technology have enabled biometric identification to facilitate digital livestock management. However, due to the unique nature of live livestock collateral, ensuring accurate identification remains a critical issue that needs to be addressed.
[0003] In existing technologies, such as cattle management, identification is primarily managed through manual marking and recording, including ear tags and RFID tags. These methods rely on the integrity and readability of physical markers. Traditional image recognition technology is also commonly used in cattle management, distinguishing cattle by their physical features. However, these methods often require manual verification to improve recognition accuracy.
[0004] During their research and development, the inventors discovered that existing manual labeling and recording methods are not only time-consuming and labor-intensive, but also prone to tampering. Furthermore, individual cattle exhibit significant similarities in appearance, making it difficult for traditional image recognition technology to effectively extract subtle differences in features. This makes it difficult to achieve the accuracy required for individual cattle identification in practical applications. Summary of the Invention
[0005] The present invention provides a risk monitoring method, device and medium for live animal mortgages based on cattle face recognition, which can significantly improve the accuracy of cattle face identification.
[0006] According to one aspect of an embodiment of the present invention, a method for monitoring risk of live animal mortgages based on cow face recognition is provided, the method comprising:
[0007] Recording cattle activities in a target monitoring area through at least one surveillance camera, and capturing a plurality of cattle face image frames from the recorded video;
[0008] The cattle herd within the target monitoring area serves as movable collateral for the target farmer's live animal mortgage loan. During the live animal mortgage loan phase, the target farmer pre-uploads videos and / or images containing all the cattle faces within the target monitoring area as a fine-tuning dataset.
[0009] Input each cow face image frame into the cow face identity recognition model respectively, and obtain a cow face identity recognition set obtained by the cow face identity recognition model for each cow face image frame;
[0010] Among them, the cow face identification model is a model obtained by fine-tuning the pre-trained improved Yolov5s model using the fine-tuning dataset;
[0011] Based on the cattle face identification set, risk monitoring is carried out on live animal mortgage loans for target farmers.
[0012] According to another aspect of an embodiment of the present invention, a risk monitoring device for live animal mortgage based on cow face recognition is provided, the device comprising:
[0013] A video acquisition module is used to record the activities of cattle in a target monitoring area through at least one surveillance camera, and to capture multiple cattle face image frames from the recorded video;
[0014] The cattle herd within the target monitoring area serves as movable collateral for the target farmer's live animal mortgage loan. During the live animal mortgage loan phase, the target farmer pre-uploads videos and / or images containing all the cattle faces within the target monitoring area as a fine-tuning dataset.
[0015] An identity recognition module is used to input each cow face image frame into a cow face identity recognition model, and obtain a cow face identity recognition set obtained by the cow face identity recognition model for each cow face image frame;
[0016] Among them, the cow face identification model is a model obtained by fine-tuning the pre-trained improved Yolov5s model using the fine-tuning dataset;
[0017] The risk monitoring module is used to monitor the risk of live animal mortgage loans for target farmers based on the cow face identity recognition set.
[0018] According to another aspect of an embodiment of the present invention, an electronic device is provided, the electronic device comprising:
[0019] at least one processor; and
[0020] a memory communicatively connected to the at least one processor; wherein,
[0021] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the risk monitoring method for live animal mortgage based on cattle face recognition as described in any embodiment of the present invention.
[0022] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a risk monitoring method for live animal mortgage based on cattle face recognition as described in any embodiment of the present invention when executed.
[0023] According to another aspect of an embodiment of the present invention, a computer program product is provided, comprising computer instructions, which implement the steps of the method according to any embodiment of the present invention when executed by a processor.
[0024] The technical solution of the embodiments of the present invention uses surveillance cameras deployed at livestock farms to continuously record the activities of mortgaged cattle and extract multiple clear cow face image frames from them. These cattle are the movable collateral explicitly agreed upon in the live livestock mortgage loan agreement between the livestock farmer and the financial institution. During the loan processing phase, the livestock farmer must submit complete cow face video and image data in advance to form a fine-tuning dataset. The system then inputs the collected cow face image frames into a fine-tuned cattle face recognition model. This model, based on an improved Yolov5s architecture and optimized using a dedicated dataset, can output an identification result for each cow. Ultimately, the financial institution uses the identification set formed from these recognition results to monitor the number of cattle and individual changes in real time by comparing them with the mortgage file, achieving precise risk management of live livestock mortgage loans. This new cattle face recognition technology enables precise supervision and automated risk management of mortgaged cattle. By optimizing the improved recognition model through the fine-tuning dataset, it can quickly adapt to the characteristic differences of cattle faces in new herds, significantly improving the generalization of the recognition model. This contactless supervision provides financial institutions with an objective and reliable basis for collateral supervision, ensuring the safe and orderly operation of loan business.
[0025] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0027] Figure 1 This is a flow chart of a method for monitoring risk of live animal mortgage based on cattle face recognition according to the first embodiment of the present invention;
[0028] Figure 2This is a specific architecture diagram of an improved Yolov5s model provided according to the first embodiment of the present invention;
[0029] Figure 3 This is a specific framework diagram of a dynamic cross-scale transformation module provided according to the first embodiment of the present invention;
[0030] Figure 4 This is a flow chart of another method for monitoring risk of live animal mortgage based on cattle face recognition according to the second embodiment of the present invention;
[0031] Figure 5 This is a specific flowchart of a method for monitoring risk of live animal mortgages based on cattle face recognition according to the third embodiment of the present invention;
[0032] Figure 6 2 is a schematic structural diagram of a risk monitoring device for live animal mortgage based on cow face recognition according to a fourth embodiment of the present invention;
[0033] Figure 7 The present invention is a schematic structural diagram of an electronic device for implementing a method for monitoring risk of live animal mortgages based on cow face recognition according to an embodiment of the present invention. DETAILED DESCRIPTION
[0034] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0035] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0036] Example 1
[0037] Figure 1This is a flowchart of a method for risk monitoring of live animal mortgages based on cattle face recognition, provided in Example 1 of the present invention. This embodiment is applicable to situations where financial institutions conduct remote intelligent supervision of live cattle mortgages of farmers. The method can be performed by a risk monitoring device for live animal mortgages based on cattle face recognition. The device can be implemented in the form of hardware and / or software and can generally be configured in an electronic device.
[0038] Correspondingly, such as Figure 1 As shown, the method includes:
[0039] S110, recording cattle activities in a target monitoring area through at least one surveillance camera, and capturing a plurality of cattle face image frames from the recorded video;
[0040] Among them, the cattle herd in the target monitoring area is the movable collateral agreed upon by the target farmer when he or she obtains a live animal mortgage loan; during the live animal mortgage loan stage, the target farmer pre-uploads videos and / or images containing all the cow faces in the cattle herd in the target monitoring area as a fine-tuning dataset.
[0041] In this embodiment, the cattle herd underlying the live animal mortgage loan is subject to continuous remote monitoring by the financial institution. By analyzing all facial image frames of the cattle captured by surveillance video, the financial institution monitors the collateralized cattle herd in real time to verify whether the herd population has decreased or individuals have been replaced, thereby ensuring that the collateral remains in a valid state consistent with the loan agreement.
[0042] Understandably, during the initial phase of live animal mortgage lending, farmers are required to submit complete biometric data of their mortgaged cattle in accordance with regulatory requirements. This step requires farmers to use specialized equipment to capture and upload facial images of each individual cattle in the herd, including multi-angle still images and dynamic video clips. Financial institutions will rigorously review the submitted images to ensure data integrity and compliance. These verified facial images will form a dedicated fine-tuning dataset, serving as a baseline for the subsequent intelligent recognition system.
[0043] The fine-tuning dataset can be understood as a customized database of cow facial features for a specific farm. While the faces of different herds share similarities in overall morphology, detailed features such as texture and contours vary from cow to cow due to individual differences and the animal's breeding environment. Therefore, a separate cow facial feature dataset must be established for each farm. By optimizing the recognition model for its environmental adaptability, it can accurately capture the unique facial feature differences of that farm's herd, ensuring high recognition accuracy in real-world applications.
[0044] Optionally, image acquisition may be performed on the recorded video at a preset sampling frequency to obtain a plurality of cow face image frames, which may be understood as video frames containing one or more complete cow faces.
[0045] S120, inputting each cow face image frame into a cow face identity recognition model, and obtaining a cow face identity recognition set obtained by the cow face identity recognition model for each cow face image frame;
[0046] Among them, the cow face identification model is a model obtained by fine-tuning the pre-trained improved Yolov5s model using the fine-tuning dataset.
[0047] In this example, the captured cow face image frames are sequentially fed into a specially optimized cow face identification model for processing. This model, based on a modified Yolov5s architecture, is trained through transfer learning using a fine-tuning dataset provided by farmers. This allows it to accurately identify the individual features of a specific herd of cattle, ultimately generating identification results that include the cattle's identity.
[0048] Understandably, the application of transfer learning adopts a two-stage model of "pre-training-fine-tuning": first, the improved Yolov5s model is pre-trained based on a large-scale general cow face dataset to enable it to master basic cow face feature extraction capabilities; then, the top-level parameters of the model are fine-tuned using the target farm's exclusive fine-tuning dataset to specifically learn the individual feature differences of the farm's cattle.
[0049] Generally speaking, by obtaining videos and / or images of all cow faces in the cattle herd within the target monitoring area uploaded by the target breeder during the live animal mortgage loan stage, a cow face identity database can be established, which contains the mapping relationship between cow face identity identifiers and matching cow face videos and / or images.
[0050] The cow face recognition model was fine-tuned using the fine-tuning dataset to fine-tune the pre-trained improved Yolov5s model. This model learned the cow face features corresponding to the cow face identities. When the image features of an input cow face image frame match the cow face features of a particular cow face, the model outputs the cow face identity corresponding to that cow face.
[0051] Correspondingly, by inputting multiple cow face image frames into the cow face identity recognition model, a cow face identity recognition set containing multiple cow identity identifiers can be output.
[0052] S130. Based on the cow face identity recognition set, risk monitoring is performed on live animal mortgage loans for target farmers.
[0053] In this embodiment, after each cow is identified and a unique identity ID is generated through the cow face recognition model, a double verification will be performed. First, the number of cows in the identification result is compared with the mortgage list to prevent the risk of a reduction in the number of mortgaged assets. Secondly, each identified cow is verified one by one to see if it is registered in the original mortgage file, thereby effectively preventing the mortgage from being replaced.
[0054] The technical solution of the embodiments of the present invention uses surveillance cameras deployed at livestock farms to continuously record the activities of mortgaged cattle and extract multiple clear cow face image frames from them. These cattle are the movable collateral explicitly agreed upon in the live livestock mortgage loan agreement between the livestock farmer and the financial institution. During the loan processing phase, the livestock farmer must submit complete cow face video and image data in advance to form a fine-tuning dataset. The system then inputs the collected cow face image frames into a fine-tuned cattle face recognition model. This model, based on an improved Yolov5s architecture and optimized using a dedicated dataset, can output an identification result for each cow. Ultimately, the financial institution uses the identification set formed from these recognition results to monitor the number of cattle and individual changes in real time by comparing them with the mortgage file, achieving precise risk management of live livestock mortgage loans. This new cattle face recognition technology enables precise supervision and automated risk management of mortgaged cattle. By optimizing the improved recognition model through the fine-tuning dataset, it can quickly adapt to the characteristic differences of cattle faces in new herds, significantly improving the generalization of the recognition model. This contactless supervision provides financial institutions with an objective and reliable basis for collateral supervision, ensuring the safe and orderly operation of loan business.
[0055] Specifically, in Figure 2 The specific architecture diagram of the improved Yolov5s model is shown in FIG.
[0056] like Figure 2 As shown in the figure, the improved Yolov5s model specifically includes an improved backbone network, an improved connection layer, and an output head, all connected in sequence. The blank boxes (i.e., the basic boxes without any slashes) in the figure represent the model structure of the original standard Yolov5s model, while the slashed boxes represent the improved model structure that this solution adds to or replaces the standard Yolov5s model.
[0057] Among them, the improved backbone network is obtained by adding four dynamic cross-scale transformation modules at intervals to the standard C3 module of the standard backbone network of the standard Yolov5s model, adding a void convolution network to the standard C3 module of the standard backbone network, and replacing the standard spatial pyramid pooling module in the standard backbone network with a fast version of the spatial pyramid pooling module; the improved connection layer is obtained by replacing the last three standard C3 modules of the standard connection layer of the standard Yolov5s model with a C3 module based on the exponential sliding attention mechanism;
[0058] The standard C3 module of the standard backbone network includes a first standard CBS module, a second standard CBS module, and a third standard CBS module connected in sequence; a dynamic cross-scale transformation module is inserted before the first standard CBS module, between the first standard CBS module and the second standard CBS module, between the second standard CBS module and the third standard CBS module, and after the third standard CBS module.
[0059] The output end of the dynamic cross-scale transformation module between the first standard CBS module and the second standard CBS module in the improved backbone network is connected to the input end of the splicing module before the third-to-last standard C3 module in the improved connection layer; the output end of the dynamic cross-scale transformation module between the second standard CBS module and the third standard CBS module in the improved backbone network is connected to the input end of the splicing module before the first standard C3 module in the improved connection layer.
[0060] In this embodiment, the proposed improved YOLOv5s model innovatively designs a Dynamic Cross-Scale Transformer (DCST) module in the backbone network. This module enhances feature extraction capabilities by deeply fusing the sliding window transformer and dilated convolution. Specifically, the DCST module combines the four different layers of the sliding window transformer with the C3 module, while embedding multi-scale dilated convolutions in the C3 (for example, the receptive field calculation formula is: RF = (ka) × r + 1). The self-attention mechanism of the sliding window transformer can capture the global contextual information of the input image, and its deep network structure can extract higher-level semantic features. The dilated convolution effectively expands the receptive field through different dilation rates (for example, r = 2, 3, 5), thereby extracting richer multi-scale local features. Finally, the standard spatial pyramid pooling module (SPP) of the backbone is replaced with a fast version of the spatial pyramid pooling module (SPPF) to alleviate the reduction in network efficiency caused by the increase in parameters.
[0061] Furthermore, in the improved connection layer, the last three standard C3 modules in the original standard connection layer are replaced with a C3-EMA module that integrates exponential moving average attention (EMA). This module enhances the ability to continuously focus on the key texture features of the cow face by maintaining a sliding average of historical attention weights. Of particular note, the improved model establishes a cross-layer feature reuse pathway: the output of the DCST module between the first and second CBS modules in the backbone network is connected to the feature splicing node (i.e., the splicing module) before the third-to-last C3 module in the connection layer; the DCST output between the second and third CBS modules is connected to the feature splicing node before the first C3 module. This design achieves dynamic fusion of multi-level features, allowing shallow detail features and deep semantic features to complement each other and enhance each other.
[0062] Specifically, if Figure 2 As shown in the figure, the standard C3 module of the standard backbone network of the standard Yolov5s model consists of three sequentially connected CBS (Conv-BN-SiLU) modules. The improved backbone network inserts DCST modules at key positions within these three CBS modules: the first DCST (i.e., DCST_12) module precedes the first CBS module, the second DCST (i.e., DCST_32) module lies between the first and second CBS modules, the third DCST (i.e., DCST_24) module lies between the second and third CBS modules, and the fourth DCST (i.e., DCST_22) module lies after the third CBS module. These four DCST modules, along with the original standard C3 module, form a hierarchical feature enhancement structure. Each DCST module integrates the windowed attention of a sliding-window Transformer and multi-scale dilated convolutions, which capture local features at different scales by adjusting the receptive field. This design ensures a balanced perception of global and local features at all layers of the network, providing richer feature representations for the subsequent cow face recognition task.
[0063] Further, in Figure 3 The specific architecture diagram of the dynamic cross-scale transformation module is shown in FIG.
[0064] like Figure 3 As shown, the dynamic cross-scale transformation module specifically includes: an input network connected in sequence, a first CBS module, a first number of bottleneck modules connected end to end (ie, Figure 3 BottleNeck_1), the splicing module, the second CBS module and the second number of first-connected sliding window Transformer modules (that is, Figure 3The sliding window Transformer Block in the network); a third CBS module is connected between the output of the input network and the input of the splicing module. Figure 3 A and B represent the number of repetitions of the BottleNeck_1 module and the sliding window Transformer Block, that is, the first number and the second number, respectively.
[0065] The bottleneck module may specifically include (not shown in the figure): a fourth CBS module, a fifth CBS module and a summing module connected in sequence, wherein the input end of the fourth CBS module is connected across the input end of the summing module.
[0066] Generally speaking, the DCST module adopts a multi-path collaborative architecture, primarily consisting of a backbone path and a crossover path. The backbone path sequentially comprises the input network, the first CBS module, multiple serially connected bottleneck modules, a concatenation module, a second CBS module, and multiple sliding-window Transformer modules. The bottleneck module employs a unique "compression-expansion-residual" architecture: after the fourth CBS module compresses the feature dimensions, the fifth CBS module expands and restores them, and finally a summation module performs a residual connection with the original input, effectively avoiding the vanishing gradient problem. The crossover path, consisting of the third CBS module, directly passes the input network features to the concatenation module, preserving the original feature information.
[0067] Furthermore, the DCST module achieves optimization through multi-level feature interaction: the sliding window Transformer module captures long-range spatial dependencies, the dilated convolution enhances local feature extraction, and the bridge path ensures feature integrity. The splicing module fuses the deep semantic features of the backbone path with the shallow detailed features of the bridge path to form a composite feature representation that combines global context and local details.
[0068] Optionally, based on the above embodiments, during the process of model pre-training and model fine-tuning of the improved Yolov5s model, a composite loss function is used to adjust the model parameters in the back-propagation stage; the composite loss function includes a classification loss sub-function, a positioning loss sub-function, and a confidence loss sub-function;
[0069] Among them, the classification loss sub-function is used to calculate the object classification error of the model using binary cross entropy, the positioning loss sub-function is used to calculate the error between the predicted box recognized by the model and the real box marked in the sample, and the confidence loss sub-function is used to calculate the model's recognition error for foreground and background objects.
[0070] In this embodiment, the composite loss function Loss of the improved Yolov5s model is calculated using the following formula: Ours ;
[0071] LossOurs =L class +L local +L SIOU
[0072] Among them, L class Represents the classification loss sub-function, L local Represents the positioning loss sub-function, L SIOU Represents the confidence loss sub-function.
[0073] The classification loss sub-function is used to calculate the classification loss. This loss allows the model to classify detected objects. It uses binary cross entropy for each label, replacing the original Softmax function and reducing computational complexity. The confidence loss sub-function is used to calculate the confidence loss. Confidence loss allows the model to learn to distinguish between detected objects as foreground and background. The localization loss sub-function is used to calculate the localization loss. The goal of the localization loss is to reduce the error between the predicted box and the ground-truth box.
[0074] Example 2
[0075] Figure 4 A flowchart of another method for risk monitoring of live animal mortgages based on cow face recognition is provided in the second embodiment of the present invention. This embodiment is optimized based on the above embodiments. In this embodiment, a method for risk monitoring of live animal mortgages based on cow face recognition is refined. Specifically, it can be as follows: before inputting each cow face image frame into the cow face identity recognition model, it can also include: obtaining a standard cow face image set and a standard cow face video set containing cow face data, and constructing a pre-training sample set based on the standard cow face image set and the standard cow face video set; pre-training a pre-constructed improved Yolov5s model based on the pre-training sample set to obtain a pre-trained improved Yolov5s model; constructing a fine-tuning training sample set based on the fine-tuning data set, and fine-tuning the pre-trained improved Yolov5s model based on the fine-tuning training sample set to obtain a cow face identity recognition model.
[0076] Correspondingly, such as Figure 4 As shown, the method may specifically include:
[0077] S410: Obtain a standard cow face image set and a standard cow face video set containing cow face data, and construct a pre-training sample set based on the standard cow face image set and the standard cow face video set.
[0078] In this embodiment, during the initial phase of building the recognition model, standardized cow face data is required as a training foundation. This process begins with the creation of a standardized cow face image and video collection. The image collection includes static photos of cow faces from various breeds and angles, while the video collection records the dynamic facial features of cows in natural activities. All collected raw data undergoes rigorous quality screening to ensure that image clarity, lighting conditions, and background environment meet pre-set standards.
[0079] Specifically, the filtered data is processed using professional annotation tools to annotate the key features of the cow's face in each image, including prominent areas such as the eyes, nose, and mouth. These standardized image frames and video clips together constitute the pre-training sample set, providing sufficient and standardized input data for subsequent deep learning model training.
[0080] S420: Pre-train the pre-built improved Yolov5s model according to the pre-training sample set to obtain a pre-trained improved Yolov5s model.
[0081] Among them, Yolov5s can be understood as the basic recognition model of this embodiment. Subsequent model improvements are implemented on the basis of this basic model, and all subsequent improvements are based on this model. The YOLO series is a classic single-stage target detection algorithm based on deep learning. Its core lies in converting target detection into a regression problem. Among many versions, Yolov5 stands out for its excellent performance in detecting small and dense targets. Considering that cow face recognition requires distinguishing subtle feature differences, this embodiment chooses Yolov5 as the basic model based on its advantages in fine feature recognition.
[0082] In this embodiment, during the pre-training process of the recognition model, a standard cow face image set and a standard cow face video set are used as input data and input into the model through batch loading. During training, the model uses cow face images with annotated boxes as supervision signals, and continuously optimizes the network parameters through the back-propagation algorithm. After each training cycle, the model performance is evaluated on the validation set, and the learning rate is dynamically adjusted based on indicators such as accuracy and recall. The training process continues until the performance of the model on the validation set tends to be stable, and finally a pre-trained model with basic cow face recognition capabilities is output. This pre-trained model has mastered the general cow face feature representation capability, but has not yet been specifically optimized for the characteristics of the cattle herd on a specific farm.
[0083] S430: construct a fine-tuning training sample set according to the fine-tuning data set, and fine-tune the pre-trained improved Yolov5s model according to the fine-tuning training sample set to obtain a cow face identity recognition model.
[0084] In this embodiment, during the model fine-tuning phase, a fine-tuning training sample set is first constructed based on the exclusive data of the mortgaged cattle herd provided by the farmers. Subsequently, the pre-trained improved Yolov5s model is used as the base model, and the parameters are fine-tuned using a transfer learning strategy.
[0085] Among them, transfer learning can be understood as a machine learning method that allows the model to quickly adapt to new tasks. It retains the general feature extraction capabilities that the pre-trained model has learned, and only adjusts some network parameters for the new task (specific cattle herd identification in this embodiment). The core of this method is that the bottom layer of the model still maintains the function of extracting the basic features of the cow's face, while the high-level network focuses on learning the individual feature differences of the cattle herd on the current farm. In this way, the model does not need to be trained from scratch, but can quickly adapt to new recognition scenarios, significantly reducing the demand for training data while ensuring recognition accuracy.
[0086] During the fine-tuning process, the weights of the model's underlying convolutional layers were kept fixed, and the main focus was on adjusting the higher-level network parameters. This allowed the model to retain its general feature extraction capabilities while focusing on learning the individual differences in characteristics of this specific herd. The fine-tuning process employed a small learning rate for iterative optimization, gradually adjusting the network parameters through a backpropagation algorithm until the model's recognition accuracy on the validation set reached a predetermined threshold. The resulting cattle face recognition model possessed the generalization capabilities of the basic model while being specifically optimized for the characteristics of the target farm's cattle, enabling it to accurately identify each individual within the mortgaged herd.
[0087] S440: Record the activities of the cattle in the target monitoring area through at least one surveillance camera, and collect a plurality of cattle face image frames from the recorded video.
[0088] Among them, the cattle herd in the target monitoring area is the movable collateral agreed upon by the target farmer when he or she obtains a live animal mortgage loan; during the live animal mortgage loan stage, the target farmer pre-uploads videos and / or images containing all the cow faces in the cattle herd in the target monitoring area as a fine-tuning dataset.
[0089] S450, inputting each cow face image frame into a cow face identity recognition model, and obtaining a cow face identity recognition set obtained by the cow face identity recognition model for each cow face image frame;
[0090] Among them, the cow face identification model is a model obtained by fine-tuning the pre-trained improved Yolov5s model using the fine-tuning dataset.
[0091] S460. Based on the cow face identity recognition set, risk monitoring is performed on live animal mortgage loans for target farmers.
[0092] The technical solution of the embodiment of the present invention continuously records cattle activities in the target breeding area through deployed surveillance cameras and extracts multiple cattle face image frames from them. At the same time, a standard cattle face image set and video set are obtained to construct a pre-training sample set for pre-training the improved Yolov5s model to obtain a basic recognition model. A fine-tuning training sample set is constructed based on the exclusive data of the mortgaged cattle provided by the farmers, and the parameters of the pre-trained model are fine-tuned to obtain a final cattle face identity recognition model. The real-time collected cattle face image frames are input into the recognition model to obtain an identification set containing the identity information of each cow. Finally, the number of cattle and identity information in the identification set are analyzed to achieve dynamic risk monitoring of live livestock mortgage loans. By constructing a standardized cattle face dataset and a two-stage model training strategy, this solution not only ensures that the basic model has good feature extraction capabilities, but also can quickly adapt to the cattle characteristics of a specific farm, significantly improving the recognition accuracy. Overall, this solution not only solves the problems of low efficiency and error-proneness of traditional manual supervision, but also provides guarantees for financial institutions to carry out rural credit business.
[0093] Optionally, based on the above embodiments, a pre-training sample set is constructed according to a standard cow face image set and a standard cow face video set, which may include:
[0094] Perform image enhancement processing on the standard cow face image set according to the preset data enhancement algorithm to obtain the first type of enhanced sample set;
[0095] According to a preset sampling interval, video frames of each standard cow face video in the standard cow face video set are sampled to obtain a standard video frame set;
[0096] Perform image enhancement processing on the standard video frame set according to a preset data enhancement algorithm to obtain a second type of enhanced sample set;
[0097] The combination of the first type of enhanced sample set and the second type of enhanced sample set is used as the pre-training sample set;
[0098] Generally speaking, to ensure the applicability and robustness of pre-trained models, it is necessary to collect a large amount of cow face data and perform data augmentation to further increase the amount of training data. Within the standard image set, pre-set data augmentation algorithms are used to process the data. These algorithms include, but are not limited to, symmetric flipping, brightness adjustment, contrast adjustment, and Gaussian noise addition. These geometric and color space transformations generate a diverse set of first-class augmented samples.
[0099] At the same time, for the video data in the standard cow face video set, the system will extract key frames at a preset sampling interval (such as an interval of 10 frames) to ensure that the continuous changes in the cow's different postures and expressions are captured to form a standard video frame set. These video frames will also undergo data enhancement processing similar to static images to generate a second type of enhanced sample set. Finally, the two types of enhanced sample sets will be merged. During the merging process, data balancing will be performed to ensure that samples of different breeds and angles are evenly distributed, and all samples will be uniformly adjusted to the input size and format required by the model, ultimately forming a complete sample set for model pre-training. The entire processing flow is completed using automated scripts to ensure consistency and repeatability in data processing.
[0100] In a specific example, the dataset contains 57 cows of different identities. The original data includes 114 static photos of cow faces (an average of 2 photos per cow) and 30 seconds of video footage. Keyframes are captured every 10 frames, and after preliminary processing, 32 valid video frame images are obtained. After systematic data augmentation and optimization, the final training set size reached 2,600 images, including 2,280 images generated by enhancing static photos and 320 images extracted and optimized by video keyframes.
[0101] Furthermore, during the construction of the fine-tuning training sample set, to ensure the model accurately learns the true facial features of the current herd, the original collected cow face images and video keyframes were used directly as training data without any data augmentation. This approach avoids feature distortion that may occur due to image transformations, ensuring that the model accurately grasps the actual biological characteristics of the target herd, thereby achieving more reliable recognition results.
[0102] It's worth noting that, given the scarcity of cow face data in practical applications, only a small amount of this data was used during fine-tuning. In one example, 23 cows were collected, yielding 46 cow face images. A 30-second video was captured every 10 frames, yielding 30 usable images. Without data augmentation, the final set of 76 images was used for fine-tuning. Finally, the model was fine-tuned and tested to produce a fine-tuned cow face recognition model.
[0103] Optionally, based on the above embodiments, risk monitoring of live animal mortgage loans for target farmers based on the cow face identity recognition set may include:
[0104] Match the cow face identification set with the pre-built movable collateral identification set to obtain the matching difference degree;
[0105] If it is determined that the matching difference is greater than or equal to the preset difference threshold, a risk warning will be issued for the target livestock mortgage loan.
[0106] Generally speaking, during the risk monitoring phase, a feature matching comparison is performed between the real-time cow face identification set and the movable collateral identification set established at the initial stage of the loan. This matching process utilizes a multi-dimensional similarity calculation algorithm, comprehensively considering the degree of difference in key biometric indicators such as the cow's facial texture and contour features, ultimately outputting a quantified match difference value.
[0107] Among them, the matching difference can be understood as a measure of the degree of match between the cow face features identified in real time and the corresponding features recorded in the original mortgage file. This value is calculated through a specific algorithm model, and its core principle is to compare the similarities or differences between the two sets of feature vectors. Specifically, the key features of the currently identified cow face will be extracted and compared with the cow feature template pre-stored in the file for multi-dimensional comparison analysis, and finally a standardized difference score will be output. The smaller the value, the higher the degree of match between the two features (such as 0 means a perfect match); the larger the value, the more obvious the difference (such as exceeding the preset threshold of 0.15 may indicate an abnormality).
[0108] Furthermore, the model presets a difference threshold parameter. When the calculated matching difference exceeds this threshold, it indicates that the mortgaged cattle herd may be experiencing a decrease in numbers or individual replacements. This automatically triggers a risk warning mechanism, marking the anomaly as a risk event and preserving a complete chain of evidence, including the relevant identification images and matching results. This risk warning information is then pushed in real time to the financial institution's regulatory terminal via pre-set channels, prompting staff to further verify the status of the target farmer's collateral. The entire matching and warning process is fully automated, ensuring timely and objective risk monitoring.
[0109] The difference threshold parameter can be understood as a core indicator for determining whether a herd's condition is abnormal. It enables risk monitoring by quantifying the degree of match between real-time identification features and the original profile. This parameter is calculated using a feature similarity algorithm based on facial features extracted by a deep learning model and is typically preset to a reasonable range of 0-0.15.
[0110] Optionally, the difference threshold can be dynamically modified by considering the biometric differences between different cattle breeds (e.g., the natural variation in facial texture of Holstein cattle is generally smaller than that of yellow cattle). Furthermore, seasonal factors (e.g., feature changes caused by winter hair growth) and environmental variables (e.g., differences in imaging from surveillance cameras under different lighting conditions) can be incorporated. For example, when systematic changes in the environment or herd characteristics are detected, the threshold interval can be automatically adjusted according to preset rules (e.g., raising the difference threshold from 0.15 to 0.18). This approach not only ensures the sensitivity of risk identification, but also effectively reduces false alarms caused by normal feature fluctuations.
[0111] Example 3
[0112] For ease of understanding, the specific application scenarios to which each embodiment of the invention is applicable are described. In this specific application scenario, in order to more accurately identify a cow face, the embodiment of the present invention designs a complete cow face recognition solution.
[0113] Specifically, in Figure 5 FIG. 4 is a flowchart showing the specific steps of a risk monitoring method for live animal mortgage based on cow face recognition according to an embodiment of the present invention. Figure 3 As shown in the figure, the scheme is mainly divided into two stages: pre-training and fine-tuning. In the pre-training stage, a dataset containing a large number of cow face images is first constructed. The original data is expanded through data augmentation techniques (including symmetric flipping, brightness adjustment, and noise addition). At the same time, the video data is extracted by intercepting one frame every 10 frames to form the key frame. Finally, a pre-training dataset is formed. Then, an improved YOLOv5s network model is built. This model introduces DCST and void convolution in the backbone network, replaces the standard SPP module with the SPPF module, embeds the EMA attention mechanism in the connection layer, and uses the SIoU loss function instead of the original CIoU loss function. The model is fully trained using the pre-training dataset to obtain a baseline model with strong generalization ability. In the fine-tuning stage, for specific application scenarios (such as a herd of cattle on a farm), only a small amount of target cow face data needs to be collected. The pre-trained model is lightly fine-tuned on this dataset and can be quickly adapted to the new cow face recognition task. This "pre-training-fine-tuning" implementation plan not only ensures the model's ability to deeply extract cow facial features, but also significantly reduces the requirement for the amount of target data. It effectively solves the problem of data scarcity in practical applications and can be quickly deployed in cow face recognition scenarios in different farms.
[0114] Furthermore, through the clever combination of the above steps, accurate recognition of cow faces can be achieved, achieving the following effective results:
[0115] 1) Through a large-scale pre-training dataset and innovative network architecture design (DCST module + EMA attention), the model has powerful cow face feature extraction capabilities, can adapt to cow face recognition tasks of different breeds and different breeding environments, and significantly improve the model's generalization performance.
[0116] 2) The improved YOLOv5s model combines the global attention mechanism of the sliding window Transformer and the multi-scale feature extraction capabilities of the dilated convolution, combined with the computational optimization of the SPPF module. While ensuring real-time performance, it significantly improves the accuracy of cow face recognition, especially the ability to distinguish subtle features (such as texture and spots).
[0117] 3) Using a “pre-training-fine-tuning” approach, only a small amount of target data is needed to complete model adaptation for new farms, solving the data scarcity problem in actual scenarios and making it particularly suitable for rapid implementation in small and medium-sized farms.
[0118] 4) Through SIoU loss function optimization and EMA attention mechanism, the model is more robust to interference factors such as lighting changes and occlusion, and can stably output cow face identification results, providing financial institutions with a reliable basis for collateral supervision and reducing the risks of live animal mortgage business.
[0119] Example 4
[0120] Figure 6 This is a schematic diagram of a risk monitoring device for live animal mortgage based on cow face recognition provided by the fourth embodiment of the present invention. Figure 6 As shown, the device includes:
[0121] The video acquisition module 610 is configured to record the activities of cattle in a target monitoring area through at least one surveillance camera, and to capture a plurality of cattle face image frames from the recorded video;
[0122] The cattle herd within the target monitoring area serves as movable collateral for the target farmer's live animal mortgage loan. During the live animal mortgage loan phase, the target farmer pre-uploads videos and / or images containing all the cattle faces within the target monitoring area as a fine-tuning dataset.
[0123] An identity recognition module 620 is configured to input each cow face image frame into a cow face identity recognition model, and obtain a cow face identity recognition set obtained by the cow face identity recognition model for each cow face image frame;
[0124] Among them, the cow face identification model is a model obtained by fine-tuning the pre-trained improved Yolov5s model using the fine-tuning dataset;
[0125] The risk monitoring module 630 is used to monitor the risk of live animal mortgage loans for target farmers based on the cow face identity recognition set.
[0126] The technical solution of the embodiments of the present invention uses surveillance cameras deployed at livestock farms to continuously record the activities of mortgaged cattle and extract multiple clear cow face image frames from them. These cattle are the movable collateral explicitly agreed upon in the live livestock mortgage loan agreement between the livestock farmer and the financial institution. During the loan processing phase, the livestock farmer must submit complete cow face video and image data in advance to form a fine-tuning dataset. The system then inputs the collected cow face image frames into a fine-tuned cattle face recognition model. This model, based on an improved Yolov5s architecture and optimized using a dedicated dataset, can output an identification result for each cow. Ultimately, the financial institution uses the identification set formed from these recognition results to monitor the number of cattle and individual changes in real time by comparing them with the mortgage file, achieving precise risk management of live livestock mortgage loans. This new cattle face recognition technology enables precise supervision and automated risk management of mortgaged cattle. By optimizing the improved recognition model through the fine-tuning dataset, it can quickly adapt to the characteristic differences of cattle faces in new herds, significantly improving the generalization of the recognition model. This contactless supervision provides financial institutions with an objective and reliable basis for collateral supervision, ensuring the safe and orderly operation of loan business.
[0127] Furthermore, based on the above embodiments, a risk monitoring device for live animal mortgage based on cattle face recognition may further include: a data acquisition module, a benchmark model module, and a recognition model construction module, wherein:
[0128] A data acquisition module is used before the identity recognition module 420 to obtain a standard cow face image set and a standard cow face video set containing cow face data, and to construct a pre-training sample set based on the standard cow face image set and the standard cow face video set;
[0129] The benchmark model module is used to pre-train the pre-built improved Yolov5s model based on the pre-training sample set to obtain a pre-trained improved Yolov5s model;
[0130] The recognition model construction module is used to construct a fine-tuning training sample set based on the fine-tuning dataset, and fine-tune the pre-trained improved Yolov5s model based on the fine-tuning training sample set to obtain a cow face identity recognition model.
[0131] Based on the above embodiments, the data acquisition module is specifically used to:
[0132] Perform image enhancement processing on the standard cow face image set according to the preset data enhancement algorithm to obtain the first type of enhanced sample set;
[0133] According to a preset sampling interval, video frames of each standard cow face video in the standard cow face video set are sampled to obtain a standard video frame set;
[0134] Perform image enhancement processing on the standard video frame set according to a preset data enhancement algorithm to obtain a second type of enhanced sample set;
[0135] The combination of the first type of enhanced sample set and the second type of enhanced sample set is used as the pre-training sample set.
[0136] On the basis of the above embodiments, the improved Yolov5s model specifically includes: an improved backbone network, an improved connection layer and an output head connected in sequence;
[0137] Among them, the improved backbone network is obtained by adding four dynamic cross-scale transformation modules at intervals to the standard C3 module of the standard backbone network of the standard Yolov5s model, adding a void convolution network to the standard C3 module of the standard backbone network, and replacing the standard spatial pyramid pooling module in the standard backbone network with a fast version of the spatial pyramid pooling module; the improved connection layer is obtained by replacing the last three standard C3 modules of the standard connection layer of the standard Yolov5s model with a C3 module based on the exponential sliding attention mechanism;
[0138] The standard C3 module of the standard backbone network includes a first standard CBS module, a second standard CBS module, and a third standard CBS module connected in sequence; a dynamic cross-scale transformation module is inserted before the first standard CBS module, between the first standard CBS module and the second standard CBS module, between the second standard CBS module and the third standard CBS module, and after the third standard CBS module.
[0139] The output end of the dynamic cross-scale transformation module between the first standard CBS module and the second standard CBS module in the improved backbone network is connected to the input end of the splicing module before the third-to-last standard C3 module in the improved connection layer; the output end of the dynamic cross-scale transformation module between the second standard CBS module and the third standard CBS module in the improved backbone network is connected to the input end of the splicing module before the first standard C3 module in the improved connection layer.
[0140] Based on the above embodiments, the dynamic cross-scale transformation module specifically includes: an input network connected in sequence, a first CBS module, a first number of bottleneck modules connected end to end, a splicing module, a second CBS module, and a second number of sliding window Transformer modules connected end to end; a third CBS module is connected between the output end of the input network and the input end of the splicing module;
[0141] The bottleneck module specifically includes: a fourth CBS module, a fifth CBS module and a summing module connected in sequence, wherein an input end of the fourth CBS module is connected across an input end of the summing module.
[0142] Based on the above embodiments, the dynamic cross-scale transformation module specifically includes: an input network connected in sequence, a first CBS module, a first number of bottleneck modules connected end to end, a splicing module, a second CBS module, and a second number of sliding window Transformer modules connected in the first place; a third CBS module is connected between the output end of the input network and the input end of the splicing module;
[0143] The bottleneck module specifically includes: a fourth CBS module, a fifth CBS module and a summing module connected in sequence, wherein an input end of the fourth CBS module is connected across an input end of the summing module.
[0144] On the basis of the above embodiments, in the process of model pre-training and model fine-tuning of the improved Yolov5s model, a composite loss function is used to adjust the model parameters in the back-propagation stage; the composite loss function includes a classification loss sub-function, a positioning loss sub-function, and a confidence loss sub-function;
[0145] Among them, the classification loss sub-function is used to calculate the object classification error of the model using binary cross entropy, the positioning loss sub-function is used to calculate the error between the predicted box recognized by the model and the real box marked in the sample, and the confidence loss sub-function is used to calculate the model's recognition error for foreground and background objects.
[0146] Based on the above embodiments, the risk monitoring module 430 is specifically configured to:
[0147] Match the cow face identification set with the pre-built movable collateral identification set to obtain the matching difference degree;
[0148] If it is determined that the matching difference is greater than or equal to the preset difference threshold, a risk warning will be issued for the target livestock mortgage loan.
[0149] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0150] Example 5
[0151] Figure 7A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0152] like Figure 7 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0153] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0154] Processor 11 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. Processor 11 executes the various methods and processes described above, such as a risk monitoring method for live livestock mortgages based on cattle face recognition, namely:
[0155] Recording cattle activities in a target monitoring area through at least one surveillance camera, and capturing a plurality of cattle face image frames from the recorded video;
[0156] The cattle herd within the target monitoring area serves as movable collateral for the target farmer's live animal mortgage loan. During the live animal mortgage loan phase, the target farmer pre-uploads videos and / or images containing all the cattle faces within the target monitoring area as a fine-tuning dataset.
[0157] Input each cow face image frame into the cow face identity recognition model respectively, and obtain a cow face identity recognition set obtained by the cow face identity recognition model for each cow face image frame;
[0158] Among them, the cow face identification model is a model obtained by fine-tuning the pre-trained improved Yolov5s model using the fine-tuning dataset;
[0159] Based on the cattle face identification set, risk monitoring is carried out on live animal mortgage loans for target farmers.
[0160] In some embodiments, a method for monitoring the risk of live livestock mortgages based on cattle face recognition may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method for monitoring the risk of live livestock mortgages based on cattle face recognition described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute a method for monitoring the risk of live livestock mortgages based on cattle face recognition in any other appropriate manner (e.g., by means of firmware).
[0161] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system comprising at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0162] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0163] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0164] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0165] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0166] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
[0167] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.
[0168] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A risk monitoring method for live animal mortgage based on cattle face recognition, characterized in that: include: Recording cattle activities in a target monitoring area through at least one surveillance camera, and capturing a plurality of cattle face image frames from the recorded video; The cattle herd within the target monitoring area serves as movable collateral for the target farmer's live animal mortgage loan. During the live animal mortgage loan phase, the target farmer pre-uploads videos and / or images containing all the cattle faces within the target monitoring area as a fine-tuning dataset. Input each cow face image frame into the cow face identity recognition model respectively, and obtain a cow face identity recognition set obtained by the cow face identity recognition model for each cow face image frame; Among them, the cow face identification model is a model obtained by fine-tuning the pre-trained improved Yolov5s model using the fine-tuning dataset; Based on the cattle face identification set, risk monitoring is carried out on live animal mortgage loans for target farmers.
2. The method according to claim 1, characterized in that Before inputting each cow face image frame into the cow face identification model, the process further includes: Obtaining a standard cow face image set and a standard cow face video set containing cow face data, and constructing a pre-training sample set based on the standard cow face image set and the standard cow face video set; Pre-training the pre-built improved Yolov5s model according to the pre-training sample set to obtain a pre-trained improved Yolov5s model; A fine-tuning training sample set is constructed according to the fine-tuning dataset, and the pre-trained improved Yolov5s model is fine-tuned according to the fine-tuning training sample set to obtain a cow face identity recognition model.
3. The method according to claim 2, characterized in that The pre-training sample set is constructed based on the standard cow face image set and the standard cow face video set, including: Perform image enhancement processing on the standard cow face image set according to the preset data enhancement algorithm to obtain the first type of enhanced sample set; According to a preset sampling interval, video frames of each standard cow face video in the standard cow face video set are sampled to obtain a standard video frame set; Perform image enhancement processing on the standard video frame set according to a preset data enhancement algorithm to obtain a second type of enhanced sample set; The combination of the first type of enhanced sample set and the second type of enhanced sample set is used as the pre-training sample set.
4. The method according to claim 1, wherein The improved Yolov5s model specifically includes: an improved backbone network, an improved connection layer, and an output head connected in sequence; Among them, the improved backbone network is obtained by adding four dynamic cross-scale transformation modules at intervals to the standard C3 module of the standard backbone network of the standard Yolov5s model, adding a void convolution network to the standard C3 module of the standard backbone network, and replacing the standard spatial pyramid pooling module in the standard backbone network with a fast version of the spatial pyramid pooling module; the improved connection layer is obtained by replacing the last three standard C3 modules of the standard connection layer of the standard Yolov5s model with a C3 module based on the exponential sliding attention mechanism; The standard C3 module of the standard backbone network includes a first standard CBS module, a second standard CBS module, and a third standard CBS module connected in sequence; a dynamic cross-scale transformation module is inserted before the first standard CBS module, between the first standard CBS module and the second standard CBS module, between the second standard CBS module and the third standard CBS module, and after the third standard CBS module. The output end of the dynamic cross-scale transformation module between the first standard CBS module and the second standard CBS module in the improved backbone network is connected to the input end of the splicing module before the third-to-last standard C3 module in the improved connection layer; the output end of the dynamic cross-scale transformation module between the second standard CBS module and the third standard CBS module in the improved backbone network is connected to the input end of the splicing module before the first standard C3 module in the improved connection layer.
5. The method according to claim 4, characterized in that The dynamic cross-scale transformation module specifically includes: an input network, a first CBS module, a first number of bottleneck modules connected end to end, a splicing module, a second CBS module, and a second number of sliding window Transformer modules connected end to end; a third CBS module is connected between the output end of the input network and the input end of the splicing module; The bottleneck module specifically includes: a fourth CBS module, a fifth CBS module and a summing module connected in sequence, wherein an input end of the fourth CBS module is connected across an input end of the summing module.
6. The method according to claim 1, characterized in that During the model pre-training and model fine-tuning of the improved Yolov5s model, a composite loss function is used to adjust the model parameters in the back-propagation stage; the composite loss function includes classification loss sub-function, positioning loss sub-function and confidence loss sub-function; Among them, the classification loss sub-function is used to calculate the object classification error of the model using binary cross entropy, the positioning loss sub-function is used to calculate the error between the predicted box recognized by the model and the real box marked in the sample, and the confidence loss sub-function is used to calculate the model's recognition error for foreground and background objects.
7. The method according to any one of claims 1 to 6, characterized in that Based on the cow face identification set, risk monitoring is performed on live animal mortgage loans for target farmers, including: Match the cow face identification set with the pre-built movable collateral identification set to obtain the matching difference degree; If it is determined that the matching difference is greater than or equal to the preset difference threshold, a risk warning will be issued for the target livestock mortgage loan.
8. A risk monitoring device for live animal mortgages based on cattle face recognition, the device comprising: A video acquisition module is used to record the activities of cattle in a target monitoring area through at least one surveillance camera, and to capture multiple cattle face image frames from the recorded video; The cattle herd within the target monitoring area serves as movable collateral for the target farmer's live animal mortgage loan. During the live animal mortgage loan phase, the target farmer pre-uploads videos and / or images containing all the cattle faces within the target monitoring area as a fine-tuning dataset. An identity recognition module is used to input each cow face image frame into a cow face identity recognition model, and obtain a cow face identity recognition set obtained by the cow face identity recognition model for each cow face image frame; Among them, the cow face identification model is a model obtained by fine-tuning the pre-trained improved Yolov5s model using the fine-tuning dataset; The risk monitoring module is used to monitor the risk of live animal mortgage loans for target farmers based on the cow face identity recognition set.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the risk monitoring method for live animal mortgage based on cattle face recognition as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a risk monitoring method for live animal mortgage based on cattle face recognition according to any one of claims 1 to 7 when executed.