Method and device for generating training sample set for animal monitoring, equipment and storage medium
By generating training sample sets, image stitching and data augmentation are performed using features of the target animal and its environmental background or animals of the same family. This solves the problem of difficult data acquisition in wildlife monitoring and improves monitoring efficiency and model performance.
Patent Information
- Application Number
- CN202411179486.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2025-01-10
AI Technical Summary
Wildlife monitoring data is difficult to obtain. Traditional monitoring relies on manual labor, which is inefficient and makes it difficult to achieve large-scale and continuous monitoring. The performance of deep learning models is limited by the quality and scale of training data.
By acquiring the identifying features of the target animal and the environmental background or conditional features of animals of the same family, image stitching and data fusion enhancement are performed to generate a training sample set, reducing the difficulty of data collection and enriching data diversity.
It improved the generalization ability of training data, reduced the manpower and time costs of data collection, and achieved efficient wildlife monitoring.
Smart Images

Figure CN119296021A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of wildlife protection technology, and in particular to a method, device, equipment and storage medium for generating a training sample set for animal monitoring. Background Art
[0002] With the increase of environmental awareness, wildlife protection has become a global focus. In order to effectively protect wildlife populations, it is crucial to develop accurate monitoring technology. However, monitoring work faces challenges such as the complexity of the natural environment, the variability of light conditions and the uncertainty of animal behavior.
[0003] Traditional monitoring relies on manual work, is inefficient and susceptible to interference, and is difficult to achieve large-scale continuous monitoring. The development of artificial intelligence and deep learning technology has provided a new approach to monitoring, improving the accuracy and efficiency of detection by automatically learning features. However, the performance of deep learning models is limited by the quality and scale of training data. It is difficult to obtain wildlife monitoring data because of their wide distribution, diverse behaviors, and legal and ethical restrictions.
[0004] Innovatively expanding and enriching datasets and increasing their diversity is the key to improving the generalization ability of models. Data augmentation technology can improve data diversity by intelligently transforming existing data, such as rotation and scaling, but it is not enough to simulate complex environments. Exploring more advanced data augmentation techniques, such as style transfer and lighting simulation, is crucial to improving model performance. Summary of the invention
[0005] The technical problem to be solved by the embodiments of the present application is to provide a method, device, equipment and storage medium for generating a training sample set for animal monitoring, so as to solve the sample required for wildlife monitoring training and effectively reduce the cost of manpower collection.
[0006] In a first aspect, an embodiment of the present application provides a method for generating a training sample set for animal monitoring, characterized in that the method comprises: Acquire identification features of a target animal corresponding to the sample object image and conditional features of a first reference object, wherein the first reference object includes an environmental background and animals of the same family; splicing each identification sub-feature of the identification feature with the conditional feature to obtain a first target image, wherein the identification feature includes a plurality of identification sub-features, and the identification sub-features correspond one-to-one to each decomposed region of the target object; Performing data fusion enhancement on the first target image and / or the sample object image to obtain a first subset of a training sample set; The training sample set further includes a second subset consisting of a plurality of the first target images.
[0007] Preferably, the method for acquiring the target animal and the first reference object comprises: In response to the image classification instruction, the collected multiple original animal images are classified according to categories to obtain first category images; Classify the first category image according to the identification features of the target animal to obtain the sample object image and the animals of the same family; The animals of the same family are other types of animals of the same family that meet the identification requirements of the target animals.
[0008] Preferably, the identification sub-feature and the conditional feature are combined to form a splicing process comprising: Acquire characteristic attributes of each of the identification sub-features; Each of the identification sub-features is spliced according to its feature attributes and the region attributes of each of the decomposed regions of the conditional feature to obtain the first target image.
[0009] Preferably, the method for combining the identification sub-feature with the conditional feature further comprises: Acquire a first training set consisting of the identification features and a second training set consisting of the conditional features; Performing model training using the first training set and the second training set to obtain an image stitching model, wherein the image stitching model includes a weight file corresponding to the training results of the first training set and the second training set; Inputting the image to be converted into the image stitching model to obtain the first target image; Wherein, the image to be converted contains animals of the same family as the target animal.
[0010] Preferably, extracting the identification sub-features of each decomposed area of the target animal comprises: Acquiring a hair image of the target animal; According to the imaging characteristics of the hair image, the target animal is divided into a plurality of continuous decomposition areas; The imaging characteristics of each of the decomposed regions are identified to obtain the identification sub-features corresponding to the position information of each of the decomposed regions.
[0011] Preferably, the target animal is a zebra, and the decomposition area division methods of the zebra include: The target animal is divided into zones according to the stripe characteristics on the surface of the zebra to obtain a plurality of decomposed regions, wherein the stripe characteristics include: stripe direction and stripe size parameters.
[0012] Preferably, the method of generating the first subset includes: Acquire a first image containing only the target animal from among the first target image and the sample object image; scaling the first image according to image parameters of a plurality of preset shooting distances to obtain a first intermediate image; fusing the first intermediate image with at least one of the environmental backgrounds to obtain a second intermediate image; Performing image enhancement on the second intermediate image and / or the first target image according to a preset increasing logic using a fuzzy function to obtain at least one second target image corresponding to the first image and / or the first target image; The first subset includes a plurality of the second target images.
[0013] On the other hand, the present invention also provides a device for generating a training sample set for animal monitoring, the device comprising: Feature extraction module: obtains the identification features of the target animal corresponding to the sample object image and the conditional features of the first reference object, wherein the first reference object includes the environmental background and animals of the same family; An image stitching module: stitching each identification sub-feature of the identification feature with the conditional feature to obtain a first target image, wherein the identification feature includes a plurality of identification sub-features, and the identification sub-features correspond one-to-one to each decomposed area of the target object; Image enhancement module: performing data fusion enhancement on the first target image and / or the sample object image to obtain a first subset of a training sample set; The training sample set further includes a second subset consisting of a plurality of the first target images.
[0014] In a third aspect, an embodiment of the present application provides an electronic device, including: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the sample acquisition method for training an oil leakage detection model as described in any one of the above items is implemented.
[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute any of the sample acquisition methods for training an oil leak detection model described above.
[0016] Compared with the prior art, the embodiments of the present application have the following advantages: The method for generating a training sample set for animal monitoring provided by the present invention classifies the collected sample images according to the target animal and the first reference object corresponding to the target animal; extracts the identification features of the target animal and the conditional features of the first reference object, wherein the conditional features include the environmental background and / or the animals of the same family as the target animal, and fuses the identification features of the environmental background and / or the animals of the same family with the identification features of the target animal to obtain a second subset required for the training of a recognition model that can be used for the target animal identification; at the same time, a method in which each identification sub-feature of the identification feature corresponds to each decomposed area of the first reference object one by one is adopted, so that the spliced first target image has a good generalization ability; at the same time, a method of secondary data fusion enhancement such as scaling, cropping, and rotating the second sample set and each sample object image is added to enrich the sample image, and this method can be used to transfer the animal image with high collection difficulty to the animal of the same family with low collection difficulty, such as transferring the collected wild tiger, zebra and other animal images to the collected cat and horse images, thereby reducing the image collection difficulty and the data collection manpower cost and time cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 A flowchart of the steps of a method for generating a training sample set for animal monitoring provided in an embodiment of the present application; Figure 2 A schematic diagram of a process for an animal of the same family as a target animal provided in an embodiment of the present application; Figure 3 A schematic diagram of a process for generating a first target image by fusing a target animal and conditional features provided in an embodiment of the present application; Figure 4 A schematic diagram of a target animal identification feature process based on hair image feature decomposition provided in an embodiment of the present application; Figure 5 A schematic diagram of the structure of a training sample set generating device for animal monitoring provided in an embodiment of the present application; Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0018] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0019] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0020] Reference Figure 1 , showing a flowchart of the steps of a method for generating a training sample set for animal monitoring provided by an embodiment of the present application, such as Figure 1 As shown, the method for generating a training sample set for animal monitoring may include: S1: Acquire identification features of a target animal corresponding to a sample object image and conditional features of a first reference object, wherein the first reference object includes an environmental background and animals of the same family; Specifically, the identification features are the obvious differences between the target animals in the same family, such as the stripes of zebras are the most direct identification features that distinguish them from other horses. The first reference object is mainly used to synthesize target animals in different scenes and with different body shapes, such as synthesizing the environmental backgrounds corresponding to zebras of different ages in spring, summer, autumn and winter. Horses are animals of the same family as zebras, and the body shape features of young, adult and old horses are used as templates for synthesizing the body shapes of zebras of different ages. Using the conditional features of animals of the same family as the template parameters of the target animals can reduce the difficulty of collecting samples of the target animals, greatly improve efficiency and reduce data collection costs.
[0021] S2: splicing each identification sub-feature of the identification feature with the conditional feature to obtain a first target image, wherein the identification feature includes a plurality of identification sub-features, and the identification sub-features correspond one-to-one to each decomposed region of the target object; Specifically, if the conditional feature is the environmental background, the target animal image is directly fused with the environment at a corresponding angle to obtain a first target image. If the conditional feature is animals of the same family, the identification feature is fused one by one with each identification sub-feature and each decomposed region of the animals of the same family to obtain the first target image. In a preferred embodiment, the initial animal images of various body shapes and age groups can be fused first, and then fused with the background environment to generate the first target image.
[0022] Furthermore, when fusing the target animal image with the environmental background, the target animal's integration area and integration orientation are first calibrated in the environmental background, and then the target animal and the environmental background are integrated within the integration area to obtain a first target image, thereby avoiding the generated first target image completely violating the activity patterns of the target animal in reality; wherein the integration area includes at least one boundary size and orientation information.
[0023] S3: performing data fusion enhancement on the first target image and / or the sample object image to obtain a first subset of a training sample set; The training sample set further includes a second subset consisting of a plurality of the first target images.
[0024] Specifically, after the first target images are obtained, each first target image is backed up as the second subset. At the same time, each first target image and each sample object image is subjected to data fusion enhancement, including rotation, light parameter adjustment, cropping, scaling, etc., to obtain each second target image, and each second target image constitutes the second subset.
[0025] The method for generating a training sample set for animal monitoring provided by the present invention classifies the collected sample images according to the target animal and the first reference object corresponding to the target animal; extracts the identification features of the target animal and the conditional features of the first reference object, wherein the conditional features include the environmental background and / or the animals of the same family as the target animal, and fuses the identification features of the environmental background and / or the animals of the same family with the identification features of the target animal to obtain a second subset required for the training of a recognition model that can be used for the target animal identification; at the same time, a method in which each identification sub-feature of the identification feature corresponds to each decomposed area of the first reference object one by one is adopted, so that the spliced first target image has a good generalization ability; at the same time, a method of secondary data fusion enhancement such as scaling, cropping, and rotating the second sample set and each sample object image is added to enrich the sample image, and this method can be used to transfer the animal image with high collection difficulty to the animal of the same family with low collection difficulty, such as transferring the collected wild tiger, zebra and other animal images to the collected cat and horse images, thereby reducing the image collection difficulty and the data collection manpower cost and time cost.
[0026] In one embodiment, if Figure 2 As shown, the above S1 specifically includes: S11: In response to the image classification instruction, the collected multiple original animal images are classified according to categories to obtain first category images; S12: classifying the first category image according to the identification features of the target animal to obtain the sample object image and the animals of the same family; The animals of the same family are other types of animals of the same family that meet the identification requirements of the target animals.
[0027] Specifically, all collected images are classified according to animal families to obtain first-category images corresponding to the target animal, and then the first-category images are divided into sample object images and animals of the same family; animals of the same family are animals that meet the physical characteristics of the target animal, such as: "horse" is regarded as an animal of the same family as "zebra"; "cat" is regarded as an animal of the same family as "tiger", while "leopard" and "lion" are not regarded as animals of the same family as "tiger". It can be seen that if animal A is regarded as an animal of the same family as animal B, the animals of the same family described here have two characteristics: characteristic one: the image of animal A can achieve the image corresponding to the physical characteristics of animal B through conventional data enhancement processing; characteristic two: the difficulty of collecting images of animal A is much less than that of animal B, such as: the image of an ordinary "horse" is easier to obtain than the image of a "zebra".
[0028] In one embodiment, if Figure 3 As shown, the above S2 specifically includes: S21: Acquire characteristic attributes of each identification sub-feature; S22: splicing each of the identification sub-features according to its feature attributes and the region attributes of each of the decomposed regions of the conditional feature to obtain the first target image.
[0029] Specifically, if the conditional feature is the environmental background, all the identification sub-features are directly fused with the background environment as a whole, and the light parameters of the image area corresponding to the target animal are adjusted according to the ambient light parameters; if the conditional feature is animals of the same family, the animals of the same family are partitioned according to the characteristics of each region of the target animal to obtain multiple decomposition regions, and then each identification sub-feature is associated with each decomposition region and fused one by one to obtain the first target image.
[0030] In one embodiment, the above S22 specifically includes: S221: Acquire a first training set consisting of the identification features and a second training set consisting of the conditional features; S222: Performing model training using the first training set and the second training set to obtain an image stitching model, wherein the image stitching model includes a weight file corresponding to the training results of the first training set and the second training set; S223: inputting the image to be converted into the image stitching model to obtain the first target image; Wherein, the image to be converted contains animals of the same family as the target animal.
[0031] Specifically, the images corresponding to the identification features are used as the first training set, and the images corresponding to the conditional features are used as the second training set; then the first training set and the second training set are sent to the CycleGAN model for training, and an image stitching model corresponding to the weight file of the first target image obtained by fusing the first training set and the second training set images that meets the requirements is trained. When images of the same family are subsequently sent to the image stitching model, multiple first target images of target animals with identification features can be output.
[0032] In one embodiment, if Figure 4 As shown, the above S2 specifically includes: S23: Acquire a hair image of the target animal; S24: dividing the target animal into a plurality of continuous decomposition regions according to the imaging characteristics of the hair image; S25: Identify the imaging characteristics of each of the decomposed regions, and obtain the identification sub-features corresponding to the position information of each of the decomposed regions.
[0033] In one embodiment, the target animal is a zebra, and the decomposition area division methods of the zebra include: The target animal is divided into zones according to the stripe characteristics on the surface of the zebra to obtain a plurality of decomposed regions, wherein the stripe characteristics include: stripe direction and stripe size parameters.
[0034] Specifically, the hair of the target animal is used as the reference dimension for identifying features, and all-round hair images of the target animal are collected. Then, using big data analysis, the hair images of the target animal are divided into multiple continuous non-intersecting regional images, and these regional images are recorded as images of each decomposed region of the target animal; the imaging characteristics of each regional image are analyzed one by one, including color arrangement relationship, direction, etc., such as: the stripe spacing, stripe direction, stripe color, etc. of zebras, and special areas such as the head include eyes. Key regional features such as ears and nose, In one embodiment, the above S3 specifically includes: S31: Acquire a first image containing only the target animal among the first target image and the sample object image; S32: scaling the first image according to image parameters of a plurality of preset shooting distances to obtain a first intermediate image; S33: fusing the first intermediate image with at least one of the environmental backgrounds to obtain a second intermediate image; S34: performing image enhancement on the second intermediate image and / or the first target image according to a preset increasing logic using a fuzzy function to obtain at least one second target image corresponding to the first image and / or the first target image; The first subset includes a plurality of the second target images.
[0035] Specifically, the sample object image is cut out by using an image processing tool to obtain a first image of only the target animal; according to the imaging parameters of the image shooting device, the imaging size parameters of the target animal at different distances are set, and the first image is scaled according to the preset imaging size parameters to obtain at least one first intermediate image; then the first intermediate image is fused with the environmental background to obtain a second intermediate image, which can be specifically fused by using the Poisson fusion cv2.seamlessClone() function or the image weight addition function cv2.addWeighted(); finally, the first target image and / or the second intermediate image are blurred to obtain each second target image for constructing the first subset, and one second intermediate image or the first target image can produce multiple second target images; the blurring method includes blurring according to preset blur parameters and preset positions, and randomly obtaining processing parameters from a blur parameter library and a coordinate range library for blurring; preferably, the Gaussian blur function GaussianBlur() is used for random blurring. The second target image can also further adjust the brightness, contrast, add noise processing, etc., so as to ensure the generalization ability of model training.
[0036] The method for generating a training sample set for animal monitoring provided by the present invention classifies the collected sample images according to the target animal and the first reference object corresponding to the target animal; extracts the identification features of the target animal and the conditional features of the first reference object, wherein the conditional features include the environmental background and / or the animals of the same family as the target animal, and fuses the identification features of the environmental background and / or the animals of the same family with the identification features of the target animal to obtain a second subset required for the training of a recognition model that can be used for the target animal identification; at the same time, a method in which each identification sub-feature of the identification feature corresponds to each decomposed area of the first reference object one by one is adopted, so that the spliced first target image has a good generalization ability; at the same time, a method of secondary data fusion enhancement such as scaling, cropping, and rotating the second sample set and each sample object image is added to enrich the sample image, and this method can be used to transfer the animal image with high collection difficulty to the animal of the same family with low collection difficulty, such as transferring the collected wild tiger, zebra and other animal images to the collected cat and horse images, thereby reducing the image collection difficulty and the data collection manpower cost and time cost.
[0037] Reference Figure 5 , shows a device for generating a training sample set for animal monitoring provided by an embodiment of the present application, the device comprising: Feature extraction module: obtains the identification features of the target animal corresponding to the sample object image and the conditional features of the first reference object, wherein the first reference object includes the environmental background and animals of the same family; An image stitching module: stitching each identification sub-feature of the identification feature with the conditional feature to obtain a first target image, wherein the identification feature includes a plurality of identification sub-features, and the identification sub-features correspond one-to-one to each decomposed area of the target object; Image enhancement module: performing data fusion enhancement on the first target image and / or the sample object image to obtain a first subset of a training sample set; The training sample set further includes a second subset consisting of a plurality of the first target images.
[0038] The device for generating a training sample set for animal monitoring provided by the present invention classifies the collected sample images according to the target animal and the first reference object corresponding to the target animal; extracts the identification features of the target animal and the conditional features of the first reference object, wherein the conditional features include the environmental background and / or the animals of the same family as the target animal, and fuses the identification features of the environmental background and / or the animals of the same family with the identification features of the target animal to obtain a second subset required for the training of a recognition model that can be used for the target animal identification; at the same time, a method of one-to-one correspondence between each identification sub-feature of the identification feature and each decomposition area of the first reference object is adopted, so that the spliced first target image has a good generalization ability; at the same time, a method of secondary data fusion enhancement such as scaling, cropping, and rotating the second sample set and each sample object image is added to enrich the sample image, and this method can be used to transfer the animal image with high collection difficulty to the animal of the same family with low collection difficulty, such as transferring the collected wild tiger, zebra and other animal images to the collected cat and horse images, thereby reducing the image collection difficulty and the data collection manpower cost and time cost.
[0039] In one embodiment, acquiring the target animal and the first reference object further comprises: An instruction response unit: in response to an image classification instruction, classifies the collected multiple original animal images by category to obtain a first category image; An image classification unit: classifies the first category image according to the identification features of the target animal to obtain the sample object image and the animals of the same family; The animals of the same family are other types of animals of the same family that meet the identification requirements of the target animals.
[0040] In one embodiment, the identification sub-feature and the conditional feature are combined together to form a concatenation of the identification sub-feature and the conditional feature. Parameter acquisition unit: acquires characteristic attributes of each identification sub-feature; An image stitching unit stitches each of the identification sub-features according to its feature attributes and the region attributes of each of the decomposed regions of the conditional feature to obtain the first target image.
[0041] In one embodiment, the identification sub-feature and the conditional feature are combined to further include: Sample set unit: obtaining a first training set consisting of the identification features and a second training set consisting of the conditional features; A sample training unit: performing model training using the first training set and the second training set to obtain an image stitching model, wherein the image stitching model includes a weight file corresponding to the training results of the first training set and the second training set; Target generation unit: inputting the image to be converted into the image stitching model to obtain the first target image; Wherein, the image to be converted contains animals of the same family as the target animal.
[0042] In one embodiment, extracting the identification sub-features of each decomposed region of the target animal includes: Image acquisition unit: acquires the hair image of the target animal; A target partitioning unit: dividing the target animal into a plurality of continuous decomposition areas according to the imaging characteristics of the hair image; Information association unit: identifies the imaging characteristics of each decomposition area, and obtains the identification sub-features corresponding to the position information of each decomposition area.
[0043] In one embodiment, the target animal is a zebra, and the decomposition area divisions of the zebra include: The target animal is divided into zones according to the stripe characteristics on the surface of the zebra to obtain a plurality of decomposed regions, wherein the stripe characteristics include: stripe direction and stripe size parameters.
[0044] In one embodiment, generating the first subset includes: An image parameter acquisition unit: acquiring a first image containing only the target animal from among the first target image and the sample object image; An image processing unit: scaling the first image according to image parameters of a plurality of preset shooting distances to obtain a first intermediate image; An image fusion unit: fusing the first intermediate image with at least one of the environmental backgrounds to obtain a second intermediate image; An image blurring unit: performing image enhancement on the second intermediate image according to a preset increasing logic by using a blurring function to obtain at least one first target image corresponding to the first image; The first subset includes a plurality of the first target images.
[0045] The device for generating a training sample set for animal monitoring provided by the present invention classifies the collected sample images according to the target animal and the first reference object corresponding to the target animal; extracts the identification features of the target animal and the conditional features of the first reference object, wherein the conditional features include the environmental background and / or the animals of the same family as the target animal, and fuses the identification features of the environmental background and / or the animals of the same family with the identification features of the target animal to obtain a second subset required for the training of a recognition model that can be used for the target animal identification; at the same time, a method of one-to-one correspondence between each identification sub-feature of the identification feature and each decomposition area of the first reference object is adopted, so that the spliced first target image has a good generalization ability; at the same time, a method of secondary data fusion enhancement such as scaling, cropping, and rotating the second sample set and each sample object image is added to enrich the sample image, and this method can be used to transfer the animal image with high collection difficulty to the animal of the same family with low collection difficulty, such as transferring the collected wild tiger, zebra and other animal images to the collected cat and horse images, thereby reducing the image collection difficulty and the data collection manpower cost and time cost.
[0046] An embodiment of the present application also 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 computer program is executed by the processor, the sample acquisition method for training an oil leakage detection model is implemented.
[0047] Figure 6 FIG. 6 is a schematic diagram showing the structure of an electronic device 600 according to an embodiment of the present invention. Figure 6 As shown, the electronic device 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 602 or computer program instructions loaded from a storage unit 608 to a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 can also be stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0048] Multiple components in the electronic device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, a microphone, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the electronic device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0049] The various processes and processing described above may be performed by the processing unit 601. For example, the method of any of the above embodiments may be implemented as a computer software program, which is tangibly contained in a computer-readable medium, such as the storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the CPU 601, one or more actions in the method described above may be performed.
[0050] In addition, an embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the sample acquisition method for training an oil leakage detection model is implemented.
[0051] The above is a detailed introduction to a method, device, electronic device and a computer-readable storage medium for generating a training sample set for animal monitoring provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for generating a training sample set for animal monitoring, characterized in that: The method comprises: Acquire identification features of a target animal corresponding to the sample object image and conditional features of a first reference object, wherein the first reference object includes an environmental background and animals of the same family; splicing each identification sub-feature of the identification feature with the conditional feature to obtain a first target image, wherein the identification feature includes a plurality of identification sub-features, and the identification sub-features correspond one-to-one to each decomposed region of the target object; Performing data fusion enhancement on the first target image and / or the sample object image to obtain a first subset of a training sample set; The training sample set further includes a second subset consisting of a plurality of the first target images.
2. The method according to claim 1, characterized in that The method for acquiring the target animal and the first reference object comprises: In response to the image classification instruction, the collected multiple original animal images are classified according to categories to obtain first category images; Classify the first category image according to the identification features of the target animal to obtain the sample object image and the animals of the same family; The animals of the same family are other types of animals of the same family that meet the identification requirements of the target animals.
3. The method according to claim 1, characterized in that The splicing of the identification sub-feature and the conditional feature includes: Acquire characteristic attributes of each of the identification sub-features; Each of the identification sub-features is spliced according to its feature attributes and the region attributes of each of the decomposed regions of the conditional feature to obtain the first target image.
4. The method according to claim 3, characterized in that The method for splicing the identification sub-feature with the conditional feature further comprises: Acquire a first training set consisting of the identification features and a second training set consisting of the conditional features; Performing model training using the first training set and the second training set to obtain an image stitching model, wherein the image stitching model includes a weight file corresponding to the training results of the first training set and the second training set; Inputting the image to be converted into the image stitching model to obtain the first target image; Wherein, the image to be converted contains animals of the same family as the target animal.
5. The method according to claim 1, characterized in that Extracting the identification sub-features of each decomposed area of the target animal includes: Acquiring a hair image of the target animal; According to the imaging characteristics of the hair image, the target animal is divided into a plurality of continuous decomposition areas; The imaging characteristics of each of the decomposed regions are identified to obtain the identification sub-features corresponding to the position information of each of the decomposed regions.
6. The method according to any one of claims 1 to 5, characterized in that: The target animal is a zebra, and the decomposition area division methods of the zebra include: The target animal is divided into zones according to the stripe characteristics on the surface of the zebra to obtain a plurality of decomposed regions, wherein the stripe characteristics include: stripe direction and stripe size parameters.
7. The method according to any one of claims 1 to 5, characterized in that: The method of generating the first subset includes: Acquire a first image containing only the target animal from among the first target image and the sample object image; scaling the first image according to image parameters of a plurality of preset shooting distances to obtain a first intermediate image; fusing the first intermediate image with at least one of the environmental backgrounds to obtain a second intermediate image; Performing image enhancement on the second intermediate image and / or the first target image according to a preset increasing logic using a fuzzy function to obtain at least one second target image corresponding to the first image and / or the first target image; The first subset includes a plurality of the second target images.
8. A device for generating a training sample set for animal monitoring, characterized in that: The device comprises: Feature extraction module: obtains the identification features of the target animal corresponding to the sample object image and the conditional features of the first reference object, wherein the first reference object includes the environmental background and animals of the same family; An image stitching module: stitching each identification sub-feature of the identification feature with the conditional feature to obtain a first target image, wherein the identification feature includes a plurality of identification sub-features, and the identification sub-features correspond one-to-one to each decomposed area of the target object; Image enhancement module: performing data fusion enhancement on the first target image and / or the sample object image to obtain a first subset of a training sample set; The training sample set further includes a second subset consisting of a plurality of the first target images.
9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the sample acquisition method for training an oil leakage detection model as described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the sample acquisition method for training an oil leakage detection model as described in any one of claims 1 to 7.