Intelligent stray cat catching device and method based on deep learning

Through the intelligent capture device based on deep learning, intelligent identification and automation modules are used to solve the problems of indiscriminate capture and repeated capture in stray cat capture, providing a suitable environment, and improving the efficiency and safety of stray cat sterilization.

CN118947677AActive Publication Date: 2024-11-15SOUTH CHINA AGRICULTURAL UNIVERSITY

Patent Information

Application Number
CN202410955677.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2024-11-15
Estimated Expiration
2044-07-17

AI Technical Summary

Technical Problem

The existing stray cat capture devices have problems such as indiscriminate capture, frightening stray cats, relying on manpower, inconvenient installation and mobility, and repeated capture, which affects the efficiency of stray cats' sterilization.

Method used

A smart capture device based on deep learning is designed, including intelligent recognition module, automatic driving module, automatic feeding module, automatic sealing module and real-time monitoring module. The camera and main control board are used to identify the breed and ear tag of the cat, and the ultrasonic wave is used. The sirens drive away non-target animals, feed food automatically, and use a revolving door to achieve capture and temperature control module to provide a suitable environment.

Benefits of technology

It improves the degree of intelligence in capturing, reduces the fright and repeated capture of stray cats, provides suitable food and environment, and improves the efficiency and safety of stray cats' sterilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118947677A_ABST
    Figure CN118947677A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of catchers, in particular to an intelligent stray cat catching device and method based on deep learning. The device consists of a main control board, a camera, a power supply, ultrasonic waves, a temperature sensor, temperature control equipment, a motor, a feeding turntable, a steering engine and a revolving door. The whole device is controlled by a core board, a deep learning model is deployed in the device, and the cat and birth control can be identified; a lamp source is arranged in the device, and internal brightness can be automatically adjusted; an automatic feeding device is arranged in the device, so that grains can be fed regularly; the device is also provided with an ultrasonic driving device, and if a target object which does not accord with capturing is in the device for a long time, an ultrasonic driving channel is started; the constant-temperature equipment is arranged in the device, so that the internal equipment can be regulated and controlled in case of extreme weather, and a suitable environment is provided for the stray cat to live over the extreme weather.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of trappers, and in particular to a stray cat intelligent trapping device and method based on deep learning. Background Art

[0002] Stray cats generally refer to cats that do not have a fixed residence and live outdoors for a long time. They may have had owners before, but were abandoned for various reasons, or their offspring reproduced on their own without human care. Stray cats are different from wild animals because they usually have a certain dependence on humans and may look for food and shelter in residential areas, parks or other places with frequent human activities. These cats may face health problems, over-breeding and the risk of conflicts with other animals or humans due to lack of proper care and management.

[0003] However, the existing stray cat capture or shelter systems all have some defects to a greater or lesser extent. Specifically, these devices capture stray cats indiscriminately and may even capture the wrong cats. These devices also have a high probability of scaring stray cats and causing stress, and rarely provide stray cats with adequate food and drinking water. Traditional capture equipment also relies heavily on human operation, which is undoubtedly disadvantageous for capturing stray cats that are cautious and timid by nature. In addition, some devices are inconvenient to move, difficult to install, or difficult to remove after installation.

[0004] Nowadays, as society pays more attention to the welfare of stray cats, some stray cats will find new homes after being rescued and sterilized, but some are simply marked on their ears after being sterilized and continue their wandering life. This also leads to frequent repeated captures when using traditional capture devices, seriously affecting the efficiency of promoting the universal sterilization of stray cats. Summary of the invention

[0005] The present invention overcomes the shortcomings of the prior art and provides a stray cat intelligent capture device and method based on deep learning.

[0006] To achieve the above-mentioned purpose, the technical solution adopted by the present invention is:

[0007] The first aspect of the present invention discloses a stray cat intelligent capture device based on deep learning, the capture device comprising:

[0008] An intelligent recognition module, the recognition module includes a camera and a main control board, the camera is connected to the main control board, and a recognition model is obtained by learning and training the characteristic image data, and the recognition model is input into the main control board, so that the recognition module can identify the breed of the cat entering the device and whether it has an ear tag during operation; wherein the characteristic image data includes the appearance of cats of different types and breeds and ear tag image data;

[0009] An intelligent driving module, wherein the driving module includes an ultrasonic alarm. If the recognition module identifies that the animal entering the device is a non-target animal, the ultrasonic alarm is controlled to emit an alarm to drive the non-target animal away;

[0010] Automatic feeding module, which can deliver cat food into the device at regular intervals to prevent non-target animals from eating up all the food in the device and making it impossible for the device to continue to lure target stray cats;

[0011] The automatic sealing module includes a revolving door and a steering gear, and the steering gear is connected to the revolving door; when the recognition module identifies that the animal entering the device is a target stray cat, the steering gear controls the revolving door to close, completing the capture; and sends a signal to the cloud device to inform that the capture is completed, prompting timely processing of the captured object;

[0012] Real-time monitoring and image transmission module, through which the images captured by the camera can be transmitted to the cloud device, and the camera can be remotely accessed through the real-time monitoring and image transmission module to observe the real-time image situation inside the device;

[0013] The temperature control module includes a temperature sensor and a temperature control device. The temperature control module is used in conjunction with an intelligent central control unit to achieve automatic temperature regulation to submit the internal temperature environment of the device.

[0014] Furthermore, in a preferred embodiment of the present invention, the feeding module is arranged at the top of the device, and the feeding module includes a feeding turntable and a motor, and the feeding turntable is driven by the motor to rotate to deliver cat food to the bottom of the device.

[0015] Furthermore, in a preferred embodiment of the present invention, a power supply is also provided inside the device, and the power supply provides power to each module inside the device.

[0016] Furthermore, in a preferred embodiment of the present invention, the trained recognition model is deployed in the main control board, and the main control board makes a judgment based on the data captured by the camera. If the animal entering the device is a non-target animal, the ultrasonic alarm is controlled to sound an alarm to drive away the non-target animal; if the animal entering the device is identified as a target stray cat, the revolving door is closed by the servo control to complete the capture.

[0017] The second aspect of the present invention discloses a training method for a recognition module of a stray cat intelligent capture device, wherein the recognition model includes a cat face recognition model and a cat ear defect recognition model;

[0018] The cat face recognition model combines local and global features, uses ResNet50 as the backbone network to obtain feature data, and sets three branches according to the characteristics of the extracted features: Middle branch, Global branch and Part branch. The Middle branch extracts the global features of the intermediate dimension of the backbone network, the Global branch extracts the global features of high dimensions, and the Part branch extracts the local features of uniformly divided blocks of size. Finally, the extracted features are fused as the feature representation for cat face re-recognition.

[0019] The cat ear defect recognition model includes a backbone network, a neck network, a detection head network and a separable self-attention module; in the input processing stage, the image data first undergoes normalization and data enhancement preprocessing steps; then, the backbone network performs deep feature extraction on the preprocessed image; the neck network performs feature fusion on the extracted feature map to enhance the model's recognition ability for multi-scale targets; the detection head is responsible for category judgment and position positioning based on the fused features; the separable self-attention module enhances the expression of contextual information and enables the feature extractor to focus on key defect areas.

[0020] The following steps are also included:

[0021] The feature map generated by Layer4 of the backbone network ResNet50 is globally averaged and globally max-pooled through the Global branch to obtain 2048-dimensional feature vectors G_Avg and G_Max. These two feature vectors are then added to obtain a new feature vector G. The vector G is then sent to the classifier to obtain the classification prediction score. The classification prediction score is first smoothed by the label. The formula is as follows:

[0022]

[0023] Where ε is the smoothing parameter; K represents the total number of labels in the classification task; y is the true label; q k is the smoothed label; k is the original label;

[0024] Then the logits are converted into probability distribution p through Softmax k :

[0025]

[0026] Where K represents the total number of labels in the classification task; logits k is the original prediction score of the original label k; logits i is the original prediction score of the i-th label in the classification task; e is a natural constant;

[0027] When p k and q k Then use the cross entropy loss to calculate the loss and get a loss value L that measures the difference between the model prediction and the smoothed label:

[0028]

[0029] At the same time, G_Avg and G_Max use triplet loss for loss calculation, and the calculation formula is as follows:

[0030]

[0031] Where N represents the feature vector of negative samples; D ia,ip represents the distance between the i-th anchor point and the i-th positive sample; D ia,in Represents the distance between the i-th anchor point and the i-th negative sample; is a hyperparameter that represents the minimum distance difference between the expected anchor-positive sample pair and the anchor-negative sample pair; L t is the loss value used to optimize the feature representation.

[0032] The following steps are also included:

[0033] The Middle branch extracts the feature map generated by Layer3 of ResNet50, and then performs global average pooling GAP and global maximum pooling GMP to generate 1024-dimensional feature vectors M_Avg and M_Max respectively, and adds them to obtain a new 1024-dimensional vector M. M is sent to the classifier to obtain the classification prediction score, and the classification prediction score is calculated by the Softmax cross entropy loss after label smoothing; Same as the Global branch, M_Avg and M_Max use triplet loss for loss calculation;

[0034] The Part branch first uses four spatial attention networks (STNs) to extract salient information areas to form four new feature maps. Then, each feature map generates two 2048-dimensional feature vectors through global average pooling (GAP) and global maximum pooling (GMP), and the two vectors are superimposed to obtain a new 2048-dimensional vector. Finally, the new vector is sent to the classifier to obtain the classification prediction score. Similar to the Global branch, the Softmax cross entropy loss after label smoothing is used for loss calculation.

[0035] The following steps are also included:

[0036] For the backbone network in the cat ear defect recognition model, the input image first passes through a root convolution layer to extract shallow features, and then passes through four feature extraction layers consisting of C2f modules and convolution modules. The SPPF module is also added to the last feature extraction layer to improve the model calculation efficiency.

[0037] For the neck network in the cat ear defect recognition model, the FPN network is used to increase the scale of the feature map by upsampling, and the feature maps of the corresponding scales of the backbone network are spliced ​​to capture the information of targets of different scales. A data path from the bottom layer to the top is set in the PAN, so that upsampling is first performed from the low-resolution feature map, and then downsampling is performed from the high-resolution feature map, and the two are linked to construct a new path method to reduce information loss and retain richer details;

[0038] For the detection head network in the cat ear defect recognition model, the detection head network includes a classification branch and a regression branch, which are responsible for predicting the category label and the target box label in the feature map respectively. Each branch contains three basic convolution blocks;

[0039] For the separable self-attention module in the cat ear defect recognition model, the separable self-attention module can separate the feature map into two parts. One part uses the self-attention mechanism for feature processing, and the other part retains the original information. Finally, the two parts are spliced ​​to obtain a complete feature map. This feature map can increase the information extraction of the context defect area while retaining the original information.

[0040] The present invention solves the technical defects existing in the background technology, and has the following beneficial effects:

[0041] This device is highly intelligent. The entire device is controlled by a core board and has a deep learning model deployed inside, which can identify cats and whether they are sterilized. There is a light source inside the device, which can adjust the internal brightness independently. There is an automatic feeding device inside the device, which can feed food at regular intervals. The device also carries an ultrasonic repellent device. If a target object that does not meet the capture requirements stays inside the device for a long time, the ultrasonic wave will be activated for channeling. There is a constant temperature device inside the device. If extreme weather occurs, the internal equipment can be adjusted to provide stray cats with a suitable environment to survive the extreme weather. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, drawings of other embodiments can be obtained based on these drawings without paying creative work.

[0043] Figure 1 It is a structural schematic diagram of the device;

[0044] Figure 2 This is a simplified control flow chart of the device;

[0045] In the figure: 1. power supply; 2. motor; 3. feeding turntable; 4. servo; 5. revolving door; 6. camera; 7. main control board; 8. light source; 9. ultrasonic alarm; 10. temperature sensor; 11. temperature control equipment. DETAILED DESCRIPTION

[0046] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0047] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.

[0048] like Figure 1 , 2 As shown, the first aspect of the present invention discloses a stray cat intelligent capture device based on deep learning, the capture device comprising:

[0049] An intelligent recognition module, the recognition module includes a camera 6 and a main control board 7, the camera 6 is connected to the main control board 7, and a recognition model is obtained by learning and training the characteristic image data, and the recognition model is input into the main control board 7, so that the recognition module can identify the breed of the cat entering the device and whether it has an ear tag during operation; wherein the characteristic image data includes the appearance of cats of different types and breeds and ear tag image data;

[0050] It should be noted that the capture device is provided with a camera 6, which is connected to the main control board 7. By inputting image data of the appearance of cats of various types and breeds and the important feature of ear tags into the core board, the core board learns and learns to identify the breed of the cat entering the device and whether it has an ear tag.

[0051] An intelligent driving module, wherein the driving module includes an ultrasonic alarm 9. If the recognition module identifies that the animal entering the device is a non-target animal, the ultrasonic alarm 9 is controlled to emit an alarm to drive away the non-target animal;

[0052] It should be noted that in order to prevent the capture of wrong objects or the device being occupied by wrong objects and affecting work, a driving device is provided inside the device. Once the camera 6 recognizes that the animal in the device is not the target animal to be captured, an alarm will be sounded to drive it away.

[0053] Automatic feeding module, which can deliver cat food into the device at regular intervals to prevent non-target animals from eating up all the food in the device and making it impossible for the device to continue to lure target stray cats;

[0054] It should be noted that the storage device for automatically delivering cat food in the device can deliver cat food into the device at a regular interval to prevent non-target animals from eating up all the food in the device and causing the device to be unable to continue to lure target stray cats.

[0055] The automatic sealing module includes a revolving door 5 and a steering engine 4, and the steering engine 4 is connected to the revolving door 5; when the recognition module identifies that the animal entering the device is a target stray cat, the steering engine 4 controls the revolving door 5 to close, completing the capture; and sends a signal to the cloud device to inform that the capture is completed, prompting the captured object to be processed in time;

[0056] It should be noted that after the camera 6 identifies the stray cat to be captured, the door of the capture device will be controlled to close automatically to complete the capture. A signal prompt is sent to the cloud device to inform that the capture is completed and to deal with the captured object in time.

[0057] A real-time monitoring and image transmission module, through which the images captured by the camera 6 can be transmitted to the cloud device, and the camera 6 can be remotely accessed through the real-time monitoring and image transmission module to observe the real-time image situation inside the device;

[0058] It should be noted that, in order to facilitate real-time observation of the status of stray cats and timely treatment, the camera 6 will regularly shoot the stray cats and transmit them to a computer or other connected device. At the same time, the camera 6 can also be accessed remotely to observe the every move of the stray cats in real time.

[0059] The temperature control module includes a temperature sensor 10 and a temperature control device 11. The temperature control module is used in conjunction with an intelligent central control unit to achieve automatic temperature regulation to submit the internal temperature environment of the device.

[0060] It should be noted that the temperature control module is used in conjunction with the intelligent central control unit to achieve automatic temperature regulation and reduce manual intervention. It provides a suitable temperature for stray cats, reduces their stress and discomfort, and prevents stray cats from suffering from hypothermia or heat stroke under extreme weather conditions.

[0061] Furthermore, in a preferred embodiment of the present invention, the feeding module is arranged at the top of the device, and the feeding module includes a feeding turntable 3 and a motor 2, and the feeding turntable 3 is driven by the motor 2 to rotate to deliver cat food to the bottom of the device.

[0062] Furthermore, in a preferred embodiment of the present invention, a power supply 1 is also provided inside the device, and the power supply 1 provides power to each module inside the device.

[0063] It should be noted that the power required by the main control board 7 is provided by the power supply 1. The main control board 7 uses the camera 6 to determine whether there are target animals inside the device, obtains the temperature environment inside the device through the temperature sensor 10, changes the temperature inside the device through the temperature control device 11, drives away non-target animals through ultrasound, controls the feeding turntable 3 to select feeding through the motor 2, and controls the revolving door 5 to open and close through the servo 4.

[0064] Furthermore, in a preferred embodiment of the present invention, the trained recognition model is deployed in the main control board 7, and the main control board 7 makes a judgment based on the data captured by the camera 6. If the animal entering the device is a non-target animal, the ultrasonic alarm 9 is controlled to sound an alarm to drive away the non-target animal; if the animal entering the device is identified as a target stray cat, the revolving door 5 is controlled to close by the servo 4 to complete the capture.

[0065] It should be noted that the trained recognition model is deployed in the main control board 7, and the main control board 7 makes a judgment based on the data captured by the camera 6. If it is an inappropriate target animal, it will be driven away by ultrasound. There is a feeding device inside the device, which feeds at regular intervals to attract stray cats into the device. During the execution process, there is a constant temperature device inside to provide a suitable temperature.

[0066] The second aspect of the present invention discloses a training method for a recognition module of a stray cat intelligent capture device, wherein the recognition model includes a cat face recognition model and a cat ear defect recognition model;

[0067] The cat face recognition model combines local and global features, uses ResNet50 as the backbone network to obtain feature data, and sets three branches according to the characteristics of the extracted features: Middle branch, Global branch and Part branch. The Middle branch extracts the global features of the intermediate dimension of the backbone network, the Global branch extracts the global features of high dimensions, and the Part branch extracts the local features of uniformly divided blocks of size. Finally, the extracted features are fused as the feature representation for cat face re-recognition.

[0068] The cat ear defect recognition model includes a backbone network, a neck network, a detection head network and a separable self-attention module; in the input processing stage, the image data first undergoes normalization and data enhancement preprocessing steps; then, the backbone network performs deep feature extraction on the preprocessed image; the neck network performs feature fusion on the extracted feature map to enhance the model's recognition ability for multi-scale targets; the detection head is responsible for category judgment and position positioning based on the fused features; the separable self-attention module enhances the expression of contextual information and enables the feature extractor to focus on key defect areas.

[0069] It should be noted that the cat face recognition model combines local and global features, uses ResNet50 as the backbone network to obtain feature data, and designs three branches based on the characteristics of the extracted features: the Middle branch extracts the global features of the middle dimension of the backbone network, the Global branch extracts the high-dimensional global features, and the Part branch extracts the local features of uniformly divided blocks. Finally, they are fused as the feature representation for cat face re-recognition.

[0070] The following steps are also included:

[0071] The feature map generated by Layer4 of the backbone network ResNet50 is subjected to global average pooling (GAP, Global Average Pooling) and global maximum pooling (GMP, Global Max Pooling) through the Global branch to obtain 2048-dimensional feature vectors G_Avg and G_Max, and then these two feature vectors are added to obtain a new feature vector G, which is then sent to the classifier to obtain the classification prediction score. The classification prediction score is first smoothed by the label, and the formula is as follows:

[0072]

[0073] Where ε is the smoothing parameter; K represents the total number of labels in the classification task; y is the true label; q k is the smoothed label; k is the original label;

[0074] Then the logits are converted into probability distribution p through Softmax k :

[0075]

[0076] Where K represents the total number of labels in the classification task; logits k is the original prediction score of the original label k; logits i is the original prediction score of the i-th label in the classification task; e is a natural constant;

[0077] When p k and q k Then use the cross entropy loss to calculate the loss and get a loss value L that measures the difference between the model prediction and the smoothed label:

[0078]

[0079] At the same time, G_Avg and G_Max use triplet loss for loss calculation, and the calculation formula is as follows:

[0080]

[0081] Where N represents the feature vector of negative samples; D ia,ip represents the distance between the i-th anchor point and the i-th positive sample; D ia,in Represents the distance between the i-th anchor point and the i-th negative sample; is a hyperparameter that represents the minimum distance difference between the expected anchor-positive sample pair and the anchor-negative sample pair; L t is the loss value used to optimize the feature representation.

[0082] The following steps are also included:

[0083] The Middle branch extracts the feature map generated by Layer3 of ResNet50, and then performs global average pooling GAP and global maximum pooling GMP to generate 1024-dimensional feature vectors M_Avg and M_Max respectively, and adds them to obtain a new 1024-dimensional vector M. M is sent to the classifier to obtain the classification prediction score, and the classification prediction score is calculated by the Softmax cross entropy loss after label smoothing; Same as the Global branch, M_Avg and M_Max use triplet loss for loss calculation;

[0084] It should be noted that the process of the Middle branch is similar to that of the Global branch, but the Middle branch extracts the feature map generated by Layer3 of ResNet50, and then performs global average pooling GAP and global maximum pooling GMP to generate 1024-dimensional feature vectors M_Avg and M_Max respectively, adding them together to obtain a new 1024-dimensional vector M, which is sent to the classifier to obtain the classification prediction score, and the classification prediction score is calculated by the Softmax cross entropy loss after label smoothing. Similarly, M_Avg and M_Max use triplet loss for loss calculation.

[0085] The Part branch first uses four spatial attention networks (STNs) to extract salient information areas to form four new feature maps. Then, each feature map generates two 2048-dimensional feature vectors through global average pooling (GAP) and global maximum pooling (GMP), and the two vectors are superimposed to obtain a new 2048-dimensional vector. Finally, the new vector is sent to the classifier to obtain the classification prediction score. Similar to the Global branch, the Softmax cross entropy loss after label smoothing is used for loss calculation.

[0086] It should be noted that the Part branch first uses four spatial attention networks STN to extract salient information areas to form four new feature maps. Then, each feature map generates two 2048-dimensional feature vectors through global average pooling GAP and global maximum pooling GMP, and the two vectors are superimposed to obtain a new vector of 2048 dimensions. Finally, the new vector is sent to the classifier to obtain the classification prediction score. Similar to the loss calculation method of the Global layer, the loss calculation is performed using the Softmax cross entropy loss after label smoothing.

[0087] The following steps are also included:

[0088] For the backbone network in the cat ear defect recognition model, the input image first passes through a root convolution layer to extract shallow features, and then passes through four feature extraction layers consisting of C2f modules and convolution modules. The SPPF module is also added to the last feature extraction layer to improve the model calculation efficiency.

[0089] For the neck network in the cat ear defect recognition model, the FPN network is used to increase the scale of the feature map by upsampling, and the feature maps of the corresponding scales of the backbone network are spliced ​​to capture the information of targets of different scales. A data path from the bottom layer to the top is set in the PAN, so that upsampling is first performed from the low-resolution feature map, and then downsampling is performed from the high-resolution feature map, and the two are linked to construct a new path method to reduce information loss and retain richer details;

[0090] For the detection head network in the cat ear defect recognition model, the detection head network includes a classification branch and a regression branch, which are responsible for predicting the category label and the target box label in the feature map respectively. Each branch contains three basic convolution blocks;

[0091] For the separable self-attention module in the cat ear defect recognition model, the separable self-attention module can separate the feature map into two parts. One part uses the self-attention mechanism for feature processing, and the other part retains the original information. Finally, the two parts are spliced ​​to obtain a complete feature map. This feature map can increase the information extraction of the context defect area while retaining the original information.

[0092] It should be noted that the cat ear defect recognition model is improved based on the YOLOv8 target detector. The entire algorithm can be divided into four parts, namely the backbone network, the neck network, the detection head network and the separable self-attention module. In the input processing stage, the image data first undergoes preprocessing steps such as normalization and data enhancement; then, the backbone network performs deep feature extraction on these preprocessed images; the neck network mainly fuses the extracted feature maps to enhance the model's recognition ability for multi-scale targets; the detection head is responsible for accurate category judgment and position positioning based on these fused features; the separable self-attention module enhances the expression of contextual information and enables the feature extractor to focus on key defect areas.

[0093] The backbone network of YOLOv8 refers to the CSPDarkNet-53 network of YOLOv5, and is improved on this basis, using the C2f module instead of the C3 module. The C2f module mainly separates the input feature channel into two parts, one part is used to retain the original feature information, and the other part is used to mine deep information through the bottleneck layer. This not only reduces the calculation dimension and training time, but also improves the robustness of the model. Specifically, the input image first passes through a root convolution layer to extract shallow features, and then passes through four feature extraction layers composed of C2f modules and convolution modules. The SPPF module is also added to the last feature extraction layer to improve the model calculation efficiency.

[0094] YOLOv8, which uses the PAN-FPN concept in the neck network, combines FPN and PAN for multi-scale feature fusion. First, the large stride (e.g., 16 times) of the final feature map in the backbone network may lead to a relatively low optimal recall rate; second, the overlap of objects in the real frame may lead to difficult-to-handle ambiguity, that is, how to determine the position of the bounding box in overlapping regression. Therefore, using the FPN network to increase the scale of the feature map by upsampling, and splicing the feature maps of the corresponding scale of the backbone network is conducive to capturing information of objects of different scales, while PAN further improves the feature fusion effect on the basis of FPN. Compared with FPN, PAN adds a data path from the bottom up. The original intention of PAN is to upsample from the low-resolution feature map first, then downsample from the high-resolution feature map, and link the two to build a new path. Unlike the simple addition method of FPN, PAN aims to reduce information loss and retain richer details by cascading feature maps of different levels, thereby significantly improving the accuracy of object detection.

[0095] In order to improve the clarity and logic of expression, YOLOv8 abandoned the previous design and adopted a decoupled detection head and anchor-based sample matching method to improve detection accuracy. The new detection head network includes a classification branch and a regression branch, which are responsible for predicting the category label and target box label in the feature map respectively. Each branch contains three basic convolution blocks. Through this design adjustment, YOLOv8 achieves more accurate target detection, which significantly improves its performance.

[0096] In order to make the model pay more attention to the semantic information extraction of the defect area, a separate self-attention module is added to the feature maps of different scales in the backbone network. Since the computational cost of the self-attention mechanism is relatively high, this module refers to the idea of ​​the C2f module and separates the feature map into two parts. One part uses the self-attention mechanism for feature processing, and the other part retains the original information. Finally, the two parts are concatenated to obtain a complete feature map. This feature map can increase the information extraction of the context defect area while retaining the original information, so that the model pays more attention to the defect area without wasting a lot of training time.

[0097] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0098] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0099] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0100] Those skilled in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, and other media that can store program codes.

[0101] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

[0102] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A stray cat intelligent capture device based on deep learning, It is characterized in that The capturing device comprises: An intelligent recognition module, the recognition module includes a camera and a main control board, the camera is connected to the main control board, and a recognition model is obtained by learning and training the characteristic image data, and the recognition model is input into the main control board, so that the recognition module can identify the breed of the cat entering the device and whether it has an ear tag during operation; wherein the characteristic image data includes the appearance of cats of different types and breeds and ear tag image data; An intelligent driving module, wherein the driving module includes an ultrasonic alarm. If the recognition module identifies that the animal entering the device is a non-target animal, the ultrasonic alarm is controlled to emit an alarm to drive the non-target animal away; Automatic feeding module, which can deliver cat food into the device at regular intervals to prevent non-target animals from eating up all the food in the device and making it impossible for the device to continue to lure target stray cats; The automatic sealing module includes a revolving door and a steering gear, and the steering gear is connected to the revolving door; when the recognition module identifies that the animal entering the device is a target stray cat, the steering gear controls the revolving door to close, completing the capture; and sends a signal to the cloud device to inform that the capture is completed, prompting timely processing of the captured object; Real-time monitoring and image transmission module, through which the images captured by the camera can be transmitted to the cloud device, and the camera can be remotely accessed through the real-time monitoring and image transmission module to observe the real-time image situation inside the device; The temperature control module includes a temperature sensor and a temperature control device. The temperature control module is used in conjunction with an intelligent central control unit to achieve automatic temperature regulation to submit the internal temperature environment of the device.

2. According to claim 1, a stray cat intelligent capture device based on deep learning, Features: The feeding module is arranged on the top of the device, and the feeding module comprises a feeding turntable and a motor. The feeding turntable is driven by the motor to rotate so as to feed cat food to the bottom of the device.

3. According to the stray cat intelligent capture device based on deep learning according to claim 1, Features: A power supply is also provided inside the device, and the power supply provides power to each module inside the device.

4. The stray cat intelligent capture device based on deep learning according to claim 1, Features: The trained recognition model is deployed to the main control board. The main control board makes a judgment based on the data captured by the camera. If the animal entering the device is a non-target animal, the ultrasonic alarm is controlled to sound an alarm to drive away the non-target animal. If the animal entering the device is identified as a target stray cat, the revolving door is controlled by the servo to close and the capture is completed.

5. A method for training the recognition module of the stray cat intelligent capture device as claimed in claim 1, Features: The recognition model includes a cat face recognition model and a cat ear defect recognition model; The cat face recognition model combines local and global features, uses ResNet50 as the backbone network to obtain feature data, and sets three branches according to the characteristics of the extracted features: Middle branch, Global branch and Part branch. The Middle branch extracts the global features of the intermediate dimension of the backbone network, the Global branch extracts the global features of high dimensions, and the Part branch extracts the local features of uniformly divided blocks of size. Finally, the extracted features are fused as the feature representation for cat face re-recognition. The cat ear defect recognition model includes a backbone network, a neck network, a detection head network, and a separable self-attention module; In the input processing stage, the image data first undergoes normalization and data augmentation preprocessing steps; Subsequently, the backbone network performs deep feature extraction on the preprocessed images; The neck network performs feature fusion on the extracted feature maps to enhance the model’s ability to recognize multi-scale targets; The detection head is responsible for category judgment and position positioning based on fusion features; The separable self-attention module enhances the expression of contextual information while making the feature extractor focus on the key defect areas.

6. The training method of the recognition module of the stray cat intelligent capture device according to claim 5, It is characterized in that The following steps are also included: The feature map generated by Layer4 of the backbone network ResNet50 is globally averaged and globally max-pooled through the Global branch to obtain 2048-dimensional feature vectors G_Avg and G_Max. These two feature vectors are then added to obtain a new feature vector G. The vector G is then sent to the classifier to obtain the classification prediction score. The classification prediction score is first smoothed by the label. The formula is as follows: Where ε is the smoothing parameter; K represents the total number of labels in the classification task; y is the true label; q k is the smoothed label; k is the original label; Then the logits are converted into probability distribution p through Softmax k : Where K represents the total number of labels in the classification task; logits k is the original prediction score of the original label k; logits i is the original prediction score of the i-th label in the classification task; e is a natural constant; When p k and q k Then use the cross entropy loss to calculate the loss and get a loss value L that measures the difference between the model prediction and the smoothed label: At the same time, G_Avg and G_Max use triplet loss for loss calculation, and the calculation formula is as follows: Where N represents the feature vector of negative samples; D ia,ip represents the distance between the i-th anchor point and the i-th positive sample; D ia,in Represents the distance between the i-th anchor point and the i-th negative sample; is a hyperparameter that represents the minimum distance difference between the expected anchor-positive sample pair and the anchor-negative sample pair; L t is the loss value used to optimize the feature representation.

7. The training method of the recognition module of the stray cat intelligent capture device according to claim 6, It is characterized in that The following steps are also included: The Middle branch extracts the feature map generated by Layer3 of ResNet50, and then performs global average pooling GAP and global maximum pooling GMP to generate 1024-dimensional feature vectors M_Avg and M_Max respectively, and adds them to obtain a new 1024-dimensional vector M. M is sent to the classifier to obtain the classification prediction score, and the classification prediction score is calculated by the Softmax cross entropy loss after label smoothing; Same as the Global branch, M_Avg and M_Max use triplet loss for loss calculation; The Part branch first uses four spatial attention networks (STNs) to extract salient information areas to form four new feature maps. Then, each feature map generates two 2048-dimensional feature vectors through global average pooling (GAP) and global maximum pooling (GMP), and the two vectors are superimposed to obtain a new 2048-dimensional vector. Finally, the new vector is sent to the classifier to obtain the classification prediction score. Similar to the Global branch, the Softmax cross entropy loss after label smoothing is used for loss calculation.

8. The training method of the recognition module of the stray cat intelligent capture device according to claim 5, It is characterized in that The following steps are also included: For the backbone network in the cat ear defect recognition model, the input image first passes through a root convolution layer to extract shallow features, and then passes through four feature extraction layers consisting of C2f modules and convolution modules. The SPPF module is also added to the last feature extraction layer to improve the model calculation efficiency. For the neck network in the cat ear defect recognition model, the FPN network is used to increase the scale of the feature map by upsampling, and the feature maps of the corresponding scales of the backbone network are spliced ​​to capture the information of targets of different scales. A data path from the bottom layer to the top is set in the PAN, so that upsampling is first performed from the low-resolution feature map, and then downsampling is performed from the high-resolution feature map, and the two are linked to construct a new path method to reduce information loss and retain richer details; For the detection head network in the cat ear defect recognition model, the detection head network includes a classification branch and a regression branch, which are responsible for predicting the category label and the target box label in the feature map respectively. Each branch contains three basic convolution blocks; For the separable self-attention module in the cat ear defect recognition model, the separable self-attention module can separate the feature map into two parts. One part uses the self-attention mechanism for feature processing, and the other part retains the original information. Finally, the two parts are spliced ​​to obtain a complete feature map. This feature map can increase the information extraction of the context defect area while retaining the original information.

Citation Information

Patent Citations

  • Global and local feature fusion-based occlusion robust pedestrian re-identification method

    CN112200111A

  • Animal trapping system and trapping robot

    CN113068680A

  • Deep learning-based cow face re-recognition method, system and device, and medium

    CN113989836A

  • Mouse detection model construction method and mouse detection method and device

    CN117671597A

  • Method and device for processing activity information of stray animals and cloud server

    CN117814136A

Cited By

  • Optical glass detection method and system based on image enhancement

    CN119850589A