A method and device for processing animal thermal infrared images
Through the improvement of the ResNet34 network model, including deleting the intermediate network layer, fusion pooling layer and setting auxiliary classifiers, the problems of low efficiency and low accuracy of animal thermal infrared image processing are solved, and efficient and accurate image processing is achieved .
Patent Information
- Application Number
- CN202210387431.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-13
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2042-04-13
AI Technical Summary
In the prior art, animal thermal infrared images are low in efficiency and low in accuracy, and cannot effectively process massive data. The thermal infrared images are easily affected by light and environment, resulting in poor resolution, low contrast, low signal-to-noise ratio, blurred regional boundaries, etc. question.
By improving the original ResNet34 network model, including deleting the intermediate network layer, fusing the maximum pooling layer and the average pooling layer, setting up auxiliary classifiers, obtaining the improved ResNet34 network model, and inputting the thermal infrared image to the improved model Obtain color information of different brightness levels to improve processing efficiency and accuracy.
It effectively improves the efficiency and accuracy of animal thermal infrared image processing, can better process massive data, and maintain high-quality processing results under the influence of light and environment.
Smart Images

Figure CN114708507B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method and device for processing thermal infrared images of animals. Background Art
[0002] With the development and application of image technology, image processing technology has been widely used. It can perform various transformations on images, identify images, etc., so as to apply image processing technology to various aspects such as animal identification, national defense, and traffic safety.
[0003] At present, the processing of animal thermal infrared image data in the industry, such as target pattern recognition, is mostly achieved by using artificial intelligence and software algorithms to perform corresponding pattern recognition algorithms on inherent platforms. However, the processing rate of animal thermal infrared image data by these animal thermal infrared image processing platforms is related to the computing power of the central processing unit of the platform. Therefore, the efficiency of animal thermal infrared image data processing is not high, and it is unable to process massive amounts of animal thermal infrared image data.
[0004] In the process of processing animal thermal infrared images, due to the different postures of animals, thermal infrared imaging is easily affected by lighting or complex environment, resulting in the obtained thermal infrared images often having poor resolution, low contrast, low signal-to-noise ratio, blurred regional boundaries, and no linear relationship between grayscale distribution and target reflection characteristics, which further affects the accuracy of animal thermal infrared image processing.
[0005] Therefore, the existing animal thermal infrared image processing technology is inefficient and has low accuracy, which is an important problem that needs to be solved in the field of image processing technology. Summary of the invention
[0006] The present invention provides a method and device for processing animal thermal infrared images, which are used to solve the defects of low efficiency and low accuracy in the prior art of animal thermal infrared image processing, improve the processing efficiency of animal thermal infrared images, and ensure the accuracy of animal thermal infrared image processing results.
[0007] On the one hand, the present invention provides a method for processing animal thermal infrared images, including: obtaining a thermal infrared image of a target animal; improving an original ResNet34 network model to obtain an improved ResNet34 network model; inputting the thermal infrared image into the improved ResNet34 network model to obtain an image processing result of the thermal infrared image, wherein the image processing result includes color information of different brightness levels.
[0008] Furthermore, the method of obtaining a thermal infrared image of a target animal includes: obtaining a thermal infrared video of the target animal; extracting a local thermal infrared image containing a preset part from the thermal infrared video, where the preset part is one or more; and performing stitching processing on the local thermal infrared images containing different preset parts to obtain the thermal infrared image.
[0009] Furthermore, the original ResNet34 network model is improved to obtain an improved ResNet34 network model, including: simplifying the residual units in the original ResNet34 network model by deleting a first preset number of intermediate network layers.
[0010] Furthermore, the improving the original ResNet34 network model to obtain the improved ResNet34 network model also includes: obtaining a preset maximum pooling layer and an average pooling layer; fusing the maximum pooling layer and the average pooling layer to obtain a target pooling layer.
[0011] Furthermore, the improving the original ResNet34 network model to obtain the improved ResNet34 network model also includes: setting a second preset number of auxiliary classifiers at preset positions of the original ResNet34 network model, and the auxiliary classifiers are composed of the target pooling layer and the fully connected layer.
[0012] Furthermore, the loss expression of the auxiliary classifier is as follows:
[0013]
[0014] Where N is the number of samples, y i is the label of sample i, is the probability that the jth auxiliary classifier predicts sample i as a positive class, L j is the loss value of the j-th auxiliary classifier.
[0015] In a second aspect, the present invention also provides a device for processing thermal infrared images of animals, comprising: a thermal infrared image acquisition module, used to acquire thermal infrared images of target animals; an improved network model acquisition module, used to improve the original ResNet34 network model to acquire an improved ResNet34 network model; an image processing result acquisition module, used to input the thermal infrared image into the improved ResNet34 network model to obtain an image processing result of the thermal infrared image, wherein the image processing result includes color information of different brightness levels.
[0016] In a third aspect, the present invention further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method for processing thermal infrared images of animals as described in any one of the above are implemented.
[0017] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described methods for processing thermal infrared images of animals.
[0018] In a fifth aspect, the present invention further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned methods for processing thermal infrared images of animals.
[0019] The method for processing animal thermal infrared images provided by the present invention improves the original ResNet34 network model to obtain an improved ResNet34 network model, and inputs the acquired thermal infrared image of the target animal into the improved ResNet34 network model to obtain an image processing result including color information of different brightness levels. This method can effectively improve the processing efficiency of animal thermal infrared images, has good robustness, and ensures the accuracy of the animal thermal infrared image processing results. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 A schematic diagram of the process of the animal thermal infrared image processing method provided by the present invention;
[0022] Figure 2 A schematic diagram of splicing local thermal infrared images of a target animal provided by the present invention;
[0023] Figure 3 A schematic diagram of the network structure of the improved ResNet34 network model provided by the present invention;
[0024] Figure 4 An example diagram of thermal infrared image processing of a cow according to the method for processing thermal infrared images of animals provided by the present invention;
[0025] Figure 5 A schematic diagram of the structure of the device for processing thermal infrared images of animals provided by the present invention;
[0026] Figure 6 This is a schematic structural diagram of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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 creative work are within the scope of protection of the present invention.
[0028] Figure 1 FIG. 2 is a flow chart showing a method for processing thermal infrared images of animals provided by the present invention. Figure 1 As shown, the method for processing the thermal infrared image of the animal includes:
[0029] S101, acquiring a thermal infrared image of a target animal;
[0030] It can be understood that to obtain a thermal infrared image of a target animal, specifically, a thermal infrared video of the target animal moving and walking can be first obtained, and then a thermal infrared image frame can be captured from the thermal infrared video, which is the thermal infrared image of the target animal.
[0031] Acquiring thermal infrared video of the target animal moving and walking can be achieved specifically through infrared thermal imaging technology, the principle of which is to use an infrared thermal imager to convert the electromagnetic wave signal radiated from the outer surface of the target animal into a visually visible video.
[0032] S102, improving the original ResNet34 network model to obtain an improved ResNet34 network model;
[0033] It is easy to understand that increasing the width and depth of the network can greatly improve the performance of the network. Deep networks generally perform better than shallow networks. However, when the number of network layers reaches a certain number, the performance of the network begins to saturate. If more network layers are added, the performance of the network will begin to degrade, and this degradation is not caused by overfitting. This shows that when the network becomes very deep, it becomes difficult to train the deep network. The emergence of the ResNet network model is to solve the performance degradation problem after the network depth becomes deeper.
[0034] According to the different network depths, the ResNet network model can be divided into ResNet18, ResNet34, ResNet50, ResNet101 and ResNet152. The original ResNet34 network model in this step is the network model with a network depth of 34.
[0035] It should be noted that, other ResNet network models with different network depths other than the ResNet34 network model are also applicable to the animal thermal red image processing method provided by the present invention.
[0036] Improving the original ResNet34 network model means improving the network structure of the original ResNet34 network model. Specifically, it can include deleting a number of intermediate network layers in the original ResNet34 network model, or adding network layers that do not exist in the original ResNet34 network model, or designing a new network layer based on the original network layer. The specific improvement method is not specifically limited here.
[0037] It can be understood that the improved ResNet34 network model obtained by improving the original ResNet34 network model can greatly improve the processing efficiency and ensure the accuracy of the processing results when processing the thermal infrared images of the target animals compared with the original ResNet34 network model.
[0038] S103, inputting the thermal infrared image into the improved ResNet34 network model to obtain an image processing result of the thermal infrared image, where the image processing result includes color information of different brightness levels.
[0039] It can be understood that, based on obtaining the thermal infrared image of the target animal in step S101 and obtaining the improved ResNet34 network model in step S102, the thermal infrared image is input into the improved ResNet34 network model, and the improved ResNet34 network model outputs the image processing result of the thermal infrared image. Among them, the image processing result includes color information of different brightness levels. Further, based on obtaining the image processing result, different brightness levels can be obtained according to these color information to classify the target animal.
[0040] In this embodiment, the original ResNet34 network model is improved to obtain an improved ResNet34 network model, and the acquired thermal infrared image of the target animal is input into the improved ResNet34 network model to obtain an image processing result including color information of different brightness levels. This method can effectively improve the processing efficiency of animal thermal infrared images, and has good robustness, thereby ensuring the accuracy of the animal thermal infrared image processing results.
[0041] On the basis of the above embodiments, further, a thermal infrared image of a target animal is obtained, including: obtaining a thermal infrared video of the target animal; extracting a local thermal infrared image containing a preset part from the thermal infrared video, where the preset part is one or more; and splicing the local thermal infrared images containing different preset parts to obtain a thermal infrared image.
[0042] It can be understood that the thermal infrared image of the target animal is obtained, specifically, the thermal infrared video of the target animal is obtained using an infrared thermal imager, and a local thermal infrared image is extracted from the thermal infrared video. The local thermal infrared image refers to an image including a preset part, and the preset part can be one or more. For example, the preset part can specifically be the eyes, nose, breast and other parts of the target animal.
[0043] After extracting the local thermal infrared image from the thermal infrared video, the local thermal infrared images containing different preset parts are spliced together to obtain the thermal infrared image of the target animal. The splicing process refers to horizontal or vertical splicing based on the length or width of the local thermal infrared image.
[0044] It should also be noted that, when performing the stitching process of the local thermal infrared images, the number of the local thermal infrared images can be selected according to the actual situation, and is not specifically limited here.
[0045] Further, Figure 2 The schematic diagram of the splicing of the local thermal infrared images of the target animal provided by the present invention is shown, and further Figure 1 The intermediate process of obtaining thermal infrared images of target animals.
[0046] like Figure 2 As shown, the figure includes two local thermal infrared images of the target animal and the thermal infrared image finally obtained by splicing, wherein the upper left is a local thermal infrared image including the breast part of the target animal, and the upper right is a local thermal infrared image including the eye part of the target animal. By splicing the local thermal infrared image including the breast part with the local thermal infrared image including the eye part, the thermal infrared image of the target animal can be obtained.
[0047] The pixel size of the local thermal infrared image containing the eye or breast of the target animal alone is 320×240, and the pixel size of the thermal infrared image containing both the eye and breast obtained by one-to-one horizontal stitching is 640×240.
[0048] In this embodiment, by acquiring a thermal infrared video of the target animal, a local thermal infrared image containing a preset part is extracted from the thermal infrared video, and the thermal infrared images containing different preset parts are spliced to obtain a thermal infrared image of the target animal. In this way, the image processing results of the preset part of the target animal can be obtained more efficiently and accurately.
[0049] On the basis of the above embodiments, the original ResNet34 network model is further improved to obtain an improved ResNet34 network model, including: simplifying the residual units in the original ResNet34 network model by deleting a first preset number of intermediate network layers; obtaining a preset maximum pooling layer and an average pooling layer; fusing the maximum pooling layer and the average pooling layer to obtain a target pooling layer; and setting a second preset number of auxiliary classifiers at a preset position of the original ResNet34 network model, the auxiliary classifiers consisting of a target pooling layer and a fully connected layer.
[0050] It is understandable that the original ResNet34 network model is improved to obtain the improved ResNet34 network model. Specifically, Figure 3 The network structure diagram of the improved ResNet34 network model provided by the present invention is shown. Figure 1 The specific structure of the improved ResNet34 network model was further expanded.
[0051] like Figure 3 As shown in the figure, the improvements made to the original ResNet34 network model include the following aspects:
[0052] (1) By deleting a first preset number of intermediate network layers, the residual units in the original ResNet34 network model are simplified.
[0053] It should be noted that the original ResNet34 network model has four pop-up layers inside, namely Figure 2 In the “layer”, layer1, layer2, layer3 and layer4 contain 3, 4, 6 and 3 residual units, i.e., basic blocks (BasicBlock), respectively.
[0054] Delete a preset number of intermediate network layers, and the specific value of the preset number can be set according to actual conditions. Figure 3For example, the preset number is 6. Specifically, 2 residual units in the pop-up layer layer2 and 4 residual units in layer3 are deleted, the deep feature extraction layer is retained, and some shallow and intermediate layers are deleted. That is, the 3, 4, 6 and 3 residual units contained in the four pop-up layers in the original ResNet34 network model are simplified to 3, 2, 2 and 3 residual units in quantity, which can greatly compress the space and reduce the amount of calculation, thereby achieving a balance between speed and accuracy.
[0055] (2) Obtain a preset maximum pooling layer and an average pooling layer; fuse the maximum pooling layer and the average pooling layer to obtain a target pooling layer.
[0056] It can be understood that the improved ResNet34 network model designs a new target pooling layer based on the original ResNet34 network model. Specifically, a maximum pooling layer and an average pooling layer of a preset size and step size are obtained, and then the maximum pooling layer and the average pooling layer are fused to obtain a target pooling layer. In a specific embodiment, the size of the maximum pooling layer and the average pooling layer are both 3×3, and the step size is 2.
[0057] It is understandable that the error of the network model in extracting image features mainly comes from two aspects: on the one hand, the large variance of the estimated value caused by the limited neighborhood size; on the other hand, the error of the convolution layer parameters causes the deviation of the estimated mean. The average pooling layer and the maximum pooling layer are used to reduce the above two errors respectively.
[0058] Specifically, the average pooling layer enables more background information of the image to be retained, and the maximum pooling layer enables more texture information to be retained. On this basis, the target pooling layer obtained by fusing the maximum pooling layer and the average pooling layer combines the advantages of both, while reducing the feature dimension, it also enhances the nonlinear expression ability of the network model, making the content of image feature extraction richer.
[0059] Based on the target pooling layer obtained by fusion, assuming that the value of a certain position in the output feature map Y can be calculated according to the value of the pooling window corresponding to the input feature map X, the specific calculation formula during forward propagation is as follows:
[0060]
[0061] Among them, n is the feature map number, c is the channel number, h is the row number, w is the column number, s is the step size, and k is the h and k w are the length and width of the pooling window respectively.
[0062] (3) A second preset number of auxiliary classifiers are set at preset positions of the original ResNet34 network model, and the auxiliary classifiers are composed of a target pooling layer and a fully connected layer.
[0063] It is understandable that a second preset number of auxiliary classifiers is set at the preset position of the original ResNet34 network model, and the auxiliary classifier is composed of a target pooling layer and a fully connected layer. Among them, the target pooling layer is obtained by fusing the maximum pooling layer and the average pooling layer. The preset position and the second preset number can be specifically set according to actual conditions and are not limited here.
[0064] by Figure 3 For example, two groups of auxiliary classifiers are set at the output layer positions of layer2 and layer3 of the original ResNet34 network model. The auxiliary classifier consists of a target pooling layer and a fully connected layer of size 3×3. Its output does not affect the classification result of the main classifier, but adds the loss value of two shallow networks during back propagation, which promotes more stable learning and better convergence of the network model.
[0065] It can be understood that the improved ResNet34 network model of the auxiliary classifier is set. The loss value of the network model is calculated by the cross entropy loss function and the loss calculation formula of the auxiliary classifier. Assume that the probability that the improved ResNet34 network model predicts that the target animal is the i-th category is p i , then the expression of the cross entropy loss function value is as follows:
[0066]
[0067] Where N is the number of samples, y i is the classification label of sample i.
[0068] The loss calculation formula of the auxiliary classifier is set as follows:
[0069]
[0070] Among them, P i j It represents the probability that the j-th auxiliary classifier predicts sample i as the positive class.
[0071] Furthermore, after adding the auxiliary classifier, the expression for calculating the total loss function value of the improved ResNet34 network model is as follows:
[0072]
[0073] Among them, M is the number of auxiliary classifiers, L j represents the loss value of the j-th classifier, is the attenuation coefficient of the jth auxiliary classifier, L is the loss value of the original classifier, and L new is the final total loss function value.
[0074] In this embodiment, based on the original ResNet34 network model, an improved ResNet34 network model is obtained by deleting a first preset number of intermediate network layers, fusing the maximum pooling layer and the average pooling layer, and setting a second preset number of auxiliary classifiers at preset positions. The improved ResNet34 network model effectively reduces the amount of calculation and greatly improves the image processing efficiency and accuracy of the network model.
[0075] in addition, Figure 4 An example diagram of cow thermal infrared image processing is shown in the method for processing animal thermal infrared images provided by the present invention.
[0076] like Figure 4 As shown in the figure, the processing of the thermal infrared image of the cow is specifically divided into four steps: S401, obtaining the thermal infrared image of the key parts of the cow, that is, the local thermal infrared image containing the preset parts mentioned above; S402, preprocessing the local thermal infrared image of the cow, that is, splicing the local thermal infrared images containing different preset parts to obtain the thermal infrared image of the target animal; S403, improving the original ResNet34 network model to obtain the improved ResNet34 network model. Specifically, the improvement method includes model simplification, adding auxiliary classifiers and multiple fusion pooling layers; S404, processing the thermal infrared image of the target animal through the improved ResNet34 network model to obtain the corresponding image processing result.
[0077] It should be noted that milk has gradually become the main source of nutrition in the daily diet of Chinese people due to its rich milk protein and vitamins. The image processing results in this application can assist in the judgment of common problems in dairy farming such as mastitis to a certain extent, thereby reducing farming risks.
[0078] The processing of the thermal infrared image of the cow also includes data enhancement of the acquired thermal infrared image, that is, sample data augmentation processing, which may specifically include translation and rotation processing of the thermal infrared image. According to the image set obtained by data enhancement, an image data set is constructed, and the image data set is divided into a training set, a verification set, and a test set at a preset ratio. For example, in a specific embodiment, the image data set is divided at a ratio of 6:2:2 to obtain the corresponding training set, verification set, and test set.
[0079] Among them, the training set is used to train the improved ResNet34 network model, the validation set is used to verify the prediction effect of the trained improved ResNet34 network model, and the test set is used to test the prediction effect of the trained improved ResNet34 network model.
[0080] Figure 5FIG. 2 shows a schematic diagram of the structure of the device for processing thermal infrared images of animals provided by the present invention. Figure 5 As shown, the animal thermal infrared image processing device includes: a thermal infrared image acquisition module 501, used to acquire the thermal infrared image of the target animal; an improved network model acquisition module 502, used to improve the original ResNet34 network model to obtain an improved ResNet34 network model; an image processing result acquisition module 503, used to input the thermal infrared image into the improved ResNet34 network model to obtain the image processing result of the thermal infrared image, and the image processing result includes color information of different brightness levels.
[0081] The animal thermal infrared image processing device provided by the present invention and the animal thermal infrared image processing method described above can be referred to each other, and will not be described in detail here.
[0082] In this embodiment, the original ResNet34 network model is improved by improving the model acquisition module 502 to obtain an improved ResNet34 network model. The image processing result acquisition module 503 inputs the thermal infrared image of the target animal acquired by the thermal infrared image acquisition module 501 into the improved ResNet34 network model to obtain an image processing result including color information of different brightness levels. The device can effectively improve the processing efficiency of animal thermal infrared images and has good robustness, thereby ensuring the accuracy of the animal thermal infrared image processing results.
[0083] Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the method for processing the thermal infrared image of an animal, the method comprising: obtaining a thermal infrared image of a target animal; improving the original ResNet34 network model to obtain an improved ResNet34 network model; inputting the thermal infrared image into the improved ResNet34 network model to obtain an image processing result of the thermal infrared image, the image processing result including color information of different brightness levels.
[0084] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0085] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the animal thermal infrared image processing method provided by the above methods, the method including: obtaining a thermal infrared image of the target animal; improving the original ResNet34 network model to obtain an improved ResNet34 network model; inputting the thermal infrared image into the improved ResNet34 network model to obtain an image processing result of the thermal infrared image, wherein the image processing result includes color information of different brightness levels.
[0086] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the animal thermal infrared image processing method provided by the above-mentioned methods, the method comprising: obtaining a thermal infrared image of the target animal; improving the original ResNet34 network model to obtain an improved ResNet34 network model; inputting the thermal infrared image into the improved ResNet34 network model to obtain an image processing result of the thermal infrared image, wherein the image processing result includes color information of different brightness levels.
[0087] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0088] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0089] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for processing animal thermal infrared images, characterized in that: include: Acquire thermal infrared images of target animals; Improve the original ResNet34 network model to obtain an improved ResNet34 network model; Inputting the thermal infrared image into the improved ResNet34 network model to obtain an image processing result of the thermal infrared image, wherein the image processing result includes color information of different brightness levels; The original ResNet34 network model is improved to obtain an improved ResNet34 network model, including: Get the preset maximum pooling layer and average pooling layer; Fusing the maximum pooling layer and the average pooling layer to obtain a target pooling layer; The improving the original ResNet34 network model to obtain the improved ResNet34 network model also includes: A second preset number of auxiliary classifiers are set at preset positions of the original ResNet34 network model, and the auxiliary classifiers are composed of the target pooling layer and the fully connected layer.
2. The method for processing animal thermal infrared images according to claim 1, characterized in that: The step of obtaining a thermal infrared image of a target animal comprises: Acquire thermal infrared video of the target animal; Extracting a local thermal infrared image containing a preset part from the thermal infrared video, wherein the preset part is one or more; The local thermal infrared images containing different preset parts are spliced to obtain the thermal infrared image.
3. The method for processing animal thermal infrared images according to claim 1, characterized in that: The improving the original ResNet34 network model to obtain the improved ResNet34 network model also includes: By deleting a first preset number of intermediate network layers, the residual units in the original ResNet34 network model are simplified.
4. The method for processing animal thermal infrared images according to claim 1, characterized in that: The loss expression of the auxiliary classifier is as follows: Where N is the number of samples, y i is the label of sample i, is the probability that the jth auxiliary classifier predicts sample i as a positive class, L j is the loss value of the j-th auxiliary classifier.
5. A device for processing thermal infrared images of animals, characterized in that: include: A thermal infrared image acquisition module, used to acquire thermal infrared images of target animals; Improved network model acquisition module, used to improve the original ResNet34 network model and obtain an improved ResNet34 network model; An image processing result acquisition module, used for inputting the thermal infrared image into the improved ResNet34 network model to obtain an image processing result of the thermal infrared image, wherein the image processing result includes color information of different brightness levels; The original ResNet34 network model is improved to obtain an improved ResNet34 network model, including: Get the preset maximum pooling layer and average pooling layer; Fusing the maximum pooling layer and the average pooling layer to obtain a target pooling layer; The improving the original ResNet34 network model to obtain the improved ResNet34 network model also includes: A second preset number of auxiliary classifiers are set at preset positions of the original ResNet34 network model, and the auxiliary classifiers are composed of the target pooling layer and the fully connected layer.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method for processing animal thermal infrared images as described in any one of claims 1 to 4 are implemented.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for processing thermal infrared images of animals as claimed in any one of claims 1 to 4 are implemented.
8. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method for processing thermal infrared images of animals as claimed in any one of claims 1 to 4 are implemented.
