Multi-target identification method and system based on animal image features

By standardizing animal images and feature extraction, deep learning models are constructed for multi-object recognition, which solves the subjectivity and inefficiency of manual recognition in the prior art, and improves the recognition accuracy and efficiency.

CN119418115AActive Publication Date: 2025-02-11SHENZHEN YICHENG SMART TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411531985.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-11
Estimated Expiration
2044-10-30

AI Technical Summary

Technical Problem

In the prior art, multi-object recognition of animal images relies on manual observation and classification, and the results are easily affected by subjective factors, which reduces the accuracy of recognition and consumes a lot of time and human resources.

Method used

By obtaining the animal images to be identified, setting the target animal ID set, conducting animal standard image query, standardizing image size, equalizing grayscale, extracting outlines and grayscale feature values, and building a deep learning model for multi-objective recognition.

Benefits of technology

It improves the accuracy of multi-objective recognition of animal images, reduces time and human resources consumption, and realizes automated multi-objective recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119418115A_ABST
    Figure CN119418115A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of animal image recognition, and discloses a multi-target recognition method and system based on animal image features, and the method comprises the steps: obtaining a to-be-recognized animal image and a target animal ID set, obtaining a standard animal image group set based on the target animal ID set, and recognizing a same-family animal image group in the standard animal image group set based on the target animal ID, the method comprises the following steps: carrying out balanced graying on a same-family animal image to obtain a gray-scale animal image, obtaining a target contour feature value and a target gray-scale feature value group based on the gray-scale animal image, carrying out key value pairing on a target animal ID, the target contour feature value and the target gray-scale feature value group to obtain a target animal feature group set, and carrying out key value pairing on the target animal ID, the target contour feature value and the target gray-scale feature value group based on the target animal feature group set. And obtaining a target animal identification model, and obtaining a multi-target animal image by using the target animal identification model. According to the invention, the accuracy of animal image multi-target recognition can be improved, and excessive consumption of time and human resources is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of animal image recognition, and in particular to a multi-target recognition method and system based on animal image features. Background Art

[0002] Animal images are an important resource for studying biodiversity and play an important role in ecological monitoring, animal protection, etc. Multi-target recognition of animal images can help related work and researchers quickly understand the morphological characteristics, living habits and geographical distribution of different animals, which is crucial for the protection and study of biodiversity.

[0003] At present, multi-target recognition of animal images mainly relies on manual observation and classification. Although this method can realize multi-target recognition of animal images, the results of manual observation and classification are easily affected by subjective factors, which reduces the accuracy of multi-target recognition and also consumes a lot of time and human resources. Summary of the invention

[0004] The present invention provides a multi-target recognition method and system based on animal image features, the main purpose of which is to improve the accuracy of multi-target recognition of animal images and reduce excessive consumption of time and human resources.

[0005] To achieve the above object, the present invention provides a multi-target recognition method based on animal image features, comprising:

[0006] Acquire an animal image to be identified, set a target animal ID set according to the animal image to be identified, perform an animal standard image query based on the target animal ID set, and obtain a target animal image group set, wherein each target animal ID in the target animal ID set corresponds to a target animal image group in the target animal image group set, and the animal image to be identified includes animal images corresponding to multiple target animal IDs;

[0007] Standardizing the image size of the target animal image set to obtain a standard animal image set, extracting target animal IDs in the target animal ID set in sequence, and identifying a group of images of animals of the same species in the standard animal image set based on the target animal IDs;

[0008] Extracting the same-family animal images in sequence from the same-family animal image group, performing balanced grayscale conversion on the same-family animal images, and obtaining grayscale animal images;

[0009] Performing contour recognition in the grayscale animal image to obtain a grayscale animal contour, identifying a grayscale contour area of ​​the grayscale animal contour, and recording the grayscale contour area as a target contour feature value;

[0010] Perform animal grayscale feature recognition based on the grayscale animal image to obtain a target grayscale feature value group;

[0011] Key-pairing the target animal ID, target contour feature value, and target grayscale feature value group to obtain a target animal feature group, and summarizing the target animal feature group to obtain a target animal feature group set;

[0012] An animal recognition model is constructed based on the target animal feature set to obtain a target animal recognition model, wherein the target animal recognition model is a deep learning model trained with the target animal feature set;

[0013] The target animal recognition model is used to perform multi-target recognition on the animal image to be recognized, to obtain multi-target animal images, and to complete multi-target recognition based on animal image features.

[0014] Optionally, the step of normalizing the image size of the target animal image set to obtain a standard animal image set includes:

[0015] Extracting target animal images in sequence from the target animal image set, and obtaining original image ratios of the target animal images;

[0016] Scaling the target animal image according to the original image ratio and the preset standard image ratio to obtain a standard animal image;

[0017] The standard animal images are aggregated to obtain a standard animal image set, and the target animal image set is updated using the standard animal image set to obtain a standard animal image set.

[0018] Optionally, performing balanced grayscale conversion on the images of animals of the same species to obtain grayscale animal images includes:

[0019] Graying the image of the same species animal to obtain an original grayscale image, wherein graying refers to converting the color space of the image of the same species animal from RGB space to grayscale space;

[0020] Extracting original grayscale points in the original grayscale image in sequence, identifying original grayscale values ​​of the original grayscale points, and summarizing the original grayscale values ​​to obtain an original grayscale value set;

[0021] Performing frequency statistics on the original grayscale value set to obtain an original grayscale frequency set, wherein the original grayscale frequencies in the original grayscale frequency set are arranged in ascending order;

[0022] The original grayscale frequencies are sequentially extracted from the original grayscale frequency set, and the frequency proportions of the original grayscale frequencies are calculated, wherein the frequency proportions are expressed as:

[0023]

[0024] Among them, Q represents the frequency proportion, n represents the number of original grayscale frequencies in the original grayscale frequency set, and L i represents the i-th original grayscale frequency, L represents the original grayscale frequency;

[0025] Determining whether the frequency weight is greater than a preset standard weight;

[0026] If the frequency weight is greater than the standard weight, the frequency weight is recorded as a dense weight, and a plurality of dense grayscale points of the dense weight are identified;

[0027] If the frequency weight is not greater than the standard weight, the frequency weight is recorded as a sparse weight, and a plurality of sparse grayscale points of the sparse weight are identified;

[0028] The plurality of dense grayscale points and the plurality of sparse grayscale points are respectively summarized to obtain a dense grayscale point set and a sparse grayscale point set, and grayscale enhancement is performed on the original grayscale image according to the dense grayscale point set and the sparse grayscale point set to obtain a grayscale animal image.

[0029] Optionally, performing grayscale enhancement on the original grayscale image according to the dense grayscale point set and the sparse grayscale point set to obtain a grayscale animal image includes:

[0030] Acquire an original grayscale range of the original grayscale image, wherein the original grayscale range includes an original minimum grayscale value and an original maximum grayscale value, and the original minimum grayscale value is 0;

[0031] Setting a balanced grayscale range, wherein the balanced grayscale range includes: a balanced minimum grayscale value and a balanced maximum grayscale value, and the balanced minimum grayscale value is 0;

[0032] Dense grayscale points are sequentially extracted from the dense grayscale point set, dense grayscale values ​​and dense grayscale frequencies of the dense grayscale points are identified, and grayscale point equalization is performed according to the dense grayscale values ​​and dense grayscale frequencies to obtain a balanced dense grayscale value, wherein the balanced dense grayscale value is expressed as:

[0033]

[0034] Among them, H′ m Indicates balanced dense grayscale value, H m Represents dense grayscale value, H y Represents the original maximum grayscale value, H h Indicates the maximum gray value of equilibrium;

[0035] The dense grayscale points are updated by using the balanced dense grayscale values ​​to obtain balanced dense points, and the balanced dense points are summarized to obtain a balanced dense point set;

[0036] According to the balanced dense point set, grayscale balancing is performed on the sparse grayscale point set to obtain a balanced sparse point set;

[0037] The original grayscale image is updated using the balanced sparse point set and the balanced dense point set to obtain a grayscale animal image.

[0038] Optionally, performing grayscale balancing on the sparse grayscale point set according to the balanced dense point set to obtain a balanced sparse point set includes:

[0039] Based on the balanced dense point set, a dense grayscale mean is calculated, wherein the dense grayscale mean is the average value of the grayscale values ​​of the balanced dense points in the balanced dense point set;

[0040] Extract sparse grayscale points in the sparse grayscale point set in sequence, identify sparse grayscale values ​​of the sparse grayscale points, and determine whether the sparse grayscale values ​​are greater than the dense grayscale mean value;

[0041] If the sparse grayscale value is greater than the dense grayscale mean value, the sparse grayscale point is updated using the balanced maximum grayscale value to obtain a balanced sparse point;

[0042] If the sparse grayscale value is not greater than the dense grayscale mean value, the sparse grayscale point is updated using the balanced minimum grayscale value to obtain a balanced sparse point;

[0043] The balanced sparse points are aggregated to obtain a balanced sparse point set.

[0044] Optionally, performing animal grayscale feature recognition based on the grayscale animal image to obtain a target grayscale feature value group includes:

[0045] Setting a neighborhood step length, sequentially extracting grayscale pixels in the grayscale animal image, performing neighborhood extraction on the grayscale pixels based on the neighborhood step length to obtain a neighborhood pixel point group, and identifying a neighborhood grayscale value group of the neighborhood pixel point group;

[0046] A neighborhood pixel matrix is ​​constructed according to the neighborhood gray value group, wherein the neighborhood pixel matrix is ​​expressed as:

[0047]

[0048] Among them, H l represents the neighborhood pixel matrix, i represents the horizontal coordinate of the grayscale pixel, j represents the vertical coordinate of the grayscale pixel, d represents the neighborhood step size, H i+d,j Indicates the neighborhood grayscale value corresponding to the neighborhood pixel point with coordinates (i+d,j), H i-d,j Indicates the neighborhood grayscale value corresponding to the neighborhood pixel point with coordinates (id, j), Hi,j+d Indicates the neighborhood grayscale value corresponding to the neighborhood pixel point with coordinates (i, j+d), H i,j-d Indicates the neighborhood grayscale value corresponding to the neighborhood pixel point with coordinates (i, jd);

[0049] According to the neighborhood pixel matrix, the pixel deviation value and pixel deviation angle are calculated using the following formula:

[0050]

[0051] Wherein, ΔH represents the pixel deviation value, |*| represents the absolute value sign, F represents the pixel deviation angle, and arctan(*) represents the inverse tangent sign;

[0052] Grayscale feature calculation is performed according to the pixel deviation value and the pixel deviation angle to obtain a target grayscale feature value group.

[0053] Optionally, the grayscale feature calculation is performed according to the pixel deviation value and the pixel deviation angle to obtain a target grayscale feature value group, including:

[0054] Determining whether the pixel deviation angle is greater than a preset standard deviation angle;

[0055] If the pixel deviation angle is greater than the standard deviation angle, the grayscale pixel point is recorded as a characteristic pixel point, the characteristic grayscale value of the characteristic pixel point is identified, and the deviation characteristic value is calculated based on the characteristic grayscale value, the pixel deviation value and the pixel deviation angle, wherein the deviation characteristic value is expressed as:

[0056] P=H t ×cos(F)+ΔH

[0057] Among them, P represents the deviation eigenvalue, H t represents the characteristic gray value, cos(*) represents the cosine function;

[0058] Summarizing the deviation eigenvalues ​​to obtain a deviation eigenvalue set, and identifying an average deviation eigenvalue, a maximum deviation eigenvalue, a minimum deviation eigenvalue, and a median deviation eigenvalue in the deviation eigenvalue set;

[0059] The average deviation eigenvalue, the maximum deviation eigenvalue, the minimum deviation eigenvalue and the median deviation eigenvalue are key-paired to obtain a target grayscale eigenvalue group.

[0060] Optionally, the using the target animal recognition model to perform multi-target recognition on the to-be-recognized animal image to obtain the multi-target animal image includes:

[0061] The image ratio of the animal image to be identified is obtained, and a plurality of mobile identification blocks are set according to the image ratio of the animal image to be identified and the standard image ratio, wherein the image ratio of the mobile identification block is the standard image ratio, and the number of the mobile identification blocks is:

[0062]

[0063] Where n′ represents the number of mobile identification blocks, Z(*) represents the upward rounding function, and C s Indicates the ratio of the image to be recognized, C b Indicates the standard image ratio;

[0064] Identify the upper left vertex of the image of the animal to be identified, record the upper left vertex as the block movement starting point, and add the multiple mobile identification blocks to the image of the animal to be identified based on the block movement starting point to obtain a block animal image, wherein the multiple mobile identification blocks are arranged in sequence from top to bottom on the left side of the image of the animal to be identified, and there is no spatial overlap between different mobile identification blocks;

[0065] Identify the right side of the animal image in the block, and record the right side as the moving terminal side of the block;

[0066] Record the current movement start time, and according to the movement start time and the preset block movement speed, use the multiple movement identification blocks to move right in the block animal image to obtain an intercepted animal region set, wherein the intercepted animal region in the intercepted animal region set corresponds to the movement identification block in the multiple movement identification blocks;

[0067] The intercepted animal regions are sequentially extracted from the intercepted animal region set, and the following operations are performed on the intercepted animal regions:

[0068] Obtaining an intercepted animal feature group of the intercepted animal region, wherein the intercepted animal feature group includes: an intercepted contour feature value and an intercepted grayscale feature value group, wherein the intercepted contour feature value is an area ratio of the intercepted animal contour in the intercepted animal region;

[0069] Inputting the intercepted animal feature group into the target animal recognition model to obtain a candidate animal ID and a candidate animal similarity, and determining whether the candidate animal similarity is greater than a preset standard animal similarity;

[0070] If the candidate animal similarity is greater than the standard animal similarity, the candidate animal ID is recorded as the identification animal ID, and the intercepted animal outline in the intercepted animal area is identified by using the identification animal ID to obtain the identified animal area;

[0071] Summarize the identified animal areas to obtain an identified animal area group, and return to the step of recording the current movement start time until the movement identification block contacts the block movement terminal edge;

[0072] The identified animal region groups are summarized to obtain an identified animal region set, and multi-target recognition is performed on the animal image to be identified based on the identified animal region set to obtain a multi-target animal image.

[0073] Optionally, performing multi-target recognition on the animal image to be recognized according to the identified animal region set to obtain multi-target animal images includes:

[0074] Extracting identified animal regions in sequence from the identified animal region set, and identifying a region group of animals of the same family as the identified animal region in the identified animal region set, wherein the ID of the same family animal in the region of the same family is the same as the ID of the identified animal in the identified animal region;

[0075] Sequentially extracting animal regions of the same species from the same species animal region group, and determining whether the identified animal region is connected to the same species animal region;

[0076] If the marked animal region is connected to the region of animals of the same species, the marked animal region and the region of animals of the same species are merged to obtain a merged animal region;

[0077] Summarizing the merged animal regions to obtain a merged animal region set, using the merged animal region set to update the identified animal region set, and returning to the step of sequentially extracting identified animal regions from the identified animal region set until there is no region group of animals of the same family in the identified animal region set;

[0078] The image of the animal to be identified is updated using the merged animal region set to obtain a multi-target animal image.

[0079] To achieve the above object, the present invention also provides a multi-target recognition system based on animal image features, comprising:

[0080] An animal image acquisition module is used to acquire an animal image to be identified, set a target animal ID set according to the animal image to be identified, perform an animal standard image query based on the target animal ID set, and obtain a target animal image group set, wherein each target animal ID in the target animal ID set corresponds to a target animal image group in the target animal image group set, and the animal image to be identified includes animal images corresponding to multiple target animal IDs;

[0081] A grayscale image conversion module is used to standardize the image size of the target animal image set to obtain a standard animal image set, sequentially extract the target animal ID from the target animal ID set, identify the same family animal image set in the standard animal image set based on the target animal ID, sequentially extract the same family animal images from the same family animal image set, and perform balanced grayscale conversion on the same family animal images to obtain grayscale animal images;

[0082] An animal feature calculation module is used to perform contour recognition in the grayscale animal image to obtain a grayscale animal contour, identify the grayscale contour area of ​​the grayscale animal contour, record the grayscale contour area as a target contour feature value, perform animal grayscale feature recognition based on the grayscale animal image to obtain a target grayscale feature value group, perform key-value pairing on the target animal ID, the target contour feature value and the target grayscale feature value group to obtain a target animal feature group, and summarize the target animal feature group to obtain a target animal feature group set;

[0083] The recognition model construction module is used to construct an animal recognition model based on the target animal feature set to obtain a target animal recognition model, wherein the target animal recognition model is a deep learning model trained with the target animal feature set, and the target animal recognition model is used to perform multi-target recognition on the animal images to be recognized to obtain multi-target animal images.

[0084] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:

[0085] a memory storing at least one instruction; and

[0086] The processor executes the instructions stored in the memory to implement the above-mentioned multi-target recognition method based on animal image features.

[0087] In order to solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one instruction is stored. The at least one instruction is executed by a processor in an electronic device to implement the above-mentioned multi-target recognition method based on animal image features.

[0088] In order to solve the problems described in the background technology, the present invention first obtains an animal image to be identified, and sets a target animal ID set according to the animal image to be identified. This step determines the animal species that may be contained in the animal image to be identified, and sets the target animal ID set accordingly, which provides a clear goal and direction for the subsequent identification process and improves the pertinence and accuracy of the identification. Then, an animal standard image query is performed based on the target animal ID set to obtain a target animal image group set. By performing the animal standard image query, a reference benchmark can be established for the animal image to be identified, ensuring that there is a reliable control group in the identification process, thereby improving the accuracy of the identification. Then, the target animal image group set is standardized in image size to obtain a standard animal image group set. The standardized image size can eliminate the influence of different image sizes on subsequent multi-target identification, ensuring that the target animal identification model can consistently process images of various sizes. Next, the target animal ID is extracted in sequence from the target animal ID set. Based on the target animal ID, an image group of the same family of animals is identified in the standard animal image group set. In the same family of animals image group, images of the same family of animals are extracted in sequence, and the images of the same family of animals are grayed out to obtain grayscale animal images. Graying can reduce the impact of lighting conditions on image recognition and make the morphological features in animal images more prominent, so as to facilitate the subsequent identification of animal features. Furthermore, contour recognition is performed in the grayscale animal image to obtain the grayscale animal contour, the grayscale contour area of ​​the grayscale animal contour is identified, and the grayscale contour area is recorded as the target contour feature value. Animal grayscale feature recognition is performed based on the grayscale animal image to obtain a target grayscale feature value group. This step extracts the animal feature value in the grayscale animal image, which provides basic data for the subsequent training of the deep learning model. Then, the target animal ID, the target contour feature value and the target grayscale feature value group are key-paired to obtain a target animal feature group. The target animal feature group is summarized to obtain a target animal feature group set, and an animal recognition model is constructed based on the target animal feature group set to obtain a target animal recognition model. The construction of the target animal recognition model can realize the automatic multi-target recognition of animal images in a specific environment, reducing the excessive consumption of time and human resources. Finally, the target animal recognition model is used to perform multi-target recognition on the animal image to be identified to obtain a multi-target animal image, thereby completing multi-target recognition based on animal image features. Therefore, the present invention can improve the accuracy of multi-target recognition of animal images and reduce excessive consumption of time and human resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0089] Figure 1 A schematic diagram of a flow chart of a multi-target recognition method based on animal image features provided by an embodiment of the present invention;

[0090] Figure 2 A functional module diagram of a multi-target recognition system based on animal image features provided by an embodiment of the present invention;

[0091] Figure 3 A schematic diagram of the structure of an electronic device for implementing the multi-target recognition method based on animal image features provided by an embodiment of the present invention.

[0092] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0093] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0094] The embodiment of the present application provides a multi-target recognition method based on animal image features. The execution subject of the multi-target recognition method based on animal image features includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided in the embodiment of the present application. In other words, the multi-target recognition method based on animal image features can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.

[0095] Reference Figure 1 FIG. 1 is a flow chart of a multi-target recognition method based on animal image features provided by an embodiment of the present invention. In this embodiment, the multi-target recognition method based on animal image features includes:

[0096] S1. Acquire an animal image to be identified, set a target animal ID set according to the animal image to be identified, perform an animal standard image query based on the target animal ID set, and obtain a target animal image group set, wherein each target animal ID in the target animal ID set corresponds to a target animal image group in the target animal image group set, and the animal image to be identified includes animal images corresponding to multiple target animal IDs.

[0097] It should be explained that the animal image to be identified refers to an image that requires multi-target identification. The animal image to be identified is obtained by artificial field photography or drone photography. The animal image to be identified may contain one or more target animals, or may not contain any target animals.

[0098] It can be understood that the target animal ID refers to a set of animal IDs that may appear in the multi-target identification. The target animal ID set is set manually according to the actual multi-target identification environment. The target animal image group refers to the image of the target animal corresponding to the target animal ID. The target animal image only contains the target animal corresponding to the target animal ID, and a target animal image only contains one target animal. It should be noted that since the feature value of the corresponding target animal ID needs to be obtained based on the target animal image later, the shooting environment of the target animal image group should be consistent with the shooting environment of the animal image to be identified. For example, if the shooting environment of the animal image to be identified is a woodland, then the shooting environment of the target animal image group should be the same woodland.

[0099] For example, Xiao Zhang is an animal management personnel. One day, Xiao Zhang needs to perform multi-target recognition on an image of an animal to be identified. Xiao Zhang finds that the shooting environment of the image of the animal to be identified is a forest. Then Xiao Zhang queries the relevant database and learns that the animals that appear in the forest are: animal a, animal b and animal c, that is, the target animal ID set is {animal a, animal b, animal c}. Then Xiao Zhang obtains the relevant images of each animal in the target animal ID set in the forest, that is, the target animal image set, where the relevant images of each animal in the forest are obtained by on-site photography by the data collection personnel of the forest, and the photographed images are stored in the animal management database for retrieval at any time.

[0100] S2. Standardize the image size of the target animal image set to obtain a standard animal image set, extract the target animal IDs in the target animal ID set in sequence, and identify the same family animal image set in the standard animal image set based on the target animal IDs.

[0101] It can be understood that the standard animal image set refers to the target animal image set after size standardization. Since the sizes of different target animal images in the target animal image set are not necessarily the same, in order to reduce the error of image comparison later, the target animal image set needs to be size standardized. The same-family animal image group refers to the standard animal image group corresponding to the target animal ID in the standard animal image group, that is, the animal ID represented by all the same-family animal images in the same-family animal image group is the target animal ID.

[0102] In detail, the step of normalizing the image size of the target animal image set to obtain a standard animal image set includes:

[0103] Extracting target animal images in sequence from the target animal image set, and obtaining original image ratios of the target animal images;

[0104] Scaling the target animal image according to the original image ratio and the preset standard image ratio to obtain a standard animal image;

[0105] The standard animal images are aggregated to obtain a standard animal image set, and the target animal image set is updated using the standard animal image set to obtain a standard animal image set.

[0106] It can be understood that the original image ratio refers to the scale between the target animal image and the actual environment, and the original image ratio should be marked when the target animal image is taken. The standard image ratio refers to an artificially set image ratio.

[0107] For example, Xiao Zhang extracts a target animal image whose original image ratio is 1:10000 and the set standard image ratio is 1:5000. Xiao Zhang then scales the target animal image: (1:5000) / (1:10000)=2, i.e., enlarges the target animal image by two times to obtain a standard animal image.

[0108] S3. Extracting images of animals of the same species from the image group of animals of the same species in sequence, performing balanced grayscale conversion on the images of animals of the same species, and obtaining grayscale animal images.

[0109] It can be understood that the grayscale animal image refers to the image of the same species of animal after balanced grayscale conversion. Since the color channel in the original image of the same species of animal is the RGB color channel, in order to reduce the subsequent calculation complexity of the image of the same species of animal, it is necessary to convert the RGB color channel into a grayscale channel. At the same time, since the grayscale distribution in the grayscale animal image is not necessarily uniform, this will cause the grayscale features of the animal in the grayscale animal image to be unclear. Therefore, it is necessary to further grayscale equalize the grayscale of the grayscale animal image so that the entire grayscale animal image can be more evenly distributed within the entire grayscale range.

[0110] In detail, the step of performing balanced grayscale conversion on the images of animals of the same species to obtain grayscale animal images includes:

[0111] Graying the image of the same species animal to obtain an original grayscale image, wherein graying refers to converting the color space of the image of the same species animal from RGB space to grayscale space;

[0112] Extracting original grayscale points in the original grayscale image in sequence, identifying original grayscale values ​​of the original grayscale points, and summarizing the original grayscale values ​​to obtain an original grayscale value set;

[0113] Performing frequency statistics on the original grayscale value set to obtain an original grayscale frequency set, wherein the original grayscale frequencies in the original grayscale frequency set are arranged in ascending order;

[0114] The original grayscale frequencies are sequentially extracted from the original grayscale frequency set, and the frequency proportions of the original grayscale frequencies are calculated, wherein the frequency proportions are expressed as:

[0115]

[0116] Among them, Q represents the frequency proportion, n represents the number of original grayscale frequencies in the original grayscale frequency set, and L i represents the i-th original grayscale frequency, L represents the original grayscale frequency;

[0117] Determining whether the frequency weight is greater than a preset standard weight;

[0118] If the frequency weight is greater than the standard weight, the frequency weight is recorded as a dense weight, and a plurality of dense grayscale points of the dense weight are identified;

[0119] If the frequency weight is not greater than the standard weight, the frequency weight is recorded as a sparse weight, and a plurality of sparse grayscale points of the sparse weight are identified;

[0120] The plurality of dense grayscale points and the plurality of sparse grayscale points are respectively summarized to obtain a dense grayscale point set and a sparse grayscale point set, and grayscale enhancement is performed on the original grayscale image according to the dense grayscale point set and the sparse grayscale point set to obtain a grayscale animal image.

[0121] It can be understood that the original grayscale image refers to the image of the same species of animals after grayscale conversion. Unlike the grayscale animal image, the original grayscale image has not undergone grayscale equalization operation. The original grayscale point refers to the pixel point in the original grayscale image. The original grayscale value refers to the grayscale value of the original grayscale point. The original grayscale frequency refers to the number of times the original grayscale value appears in the original grayscale value set. The frequency ratio refers to the proportion of the original grayscale frequency in the original grayscale frequency set. The standard ratio refers to a constant set artificially. The dense grayscale point refers to the original grayscale point corresponding to the dense ratio. The sparse grayscale point refers to the original grayscale point corresponding to the sparse ratio.

[0122] In detail, the grayscale enhancement of the original grayscale image is performed according to the dense grayscale point set and the sparse grayscale point set to obtain the grayscale animal image, including:

[0123] Acquire an original grayscale range of the original grayscale image, wherein the original grayscale range includes an original minimum grayscale value and an original maximum grayscale value, and the original minimum grayscale value is 0;

[0124] Setting a balanced grayscale range, wherein the balanced grayscale range includes: a balanced minimum grayscale value and a balanced maximum grayscale value, and the balanced minimum grayscale value is 0;

[0125] Dense grayscale points are sequentially extracted from the dense grayscale point set, dense grayscale values ​​and dense grayscale frequencies of the dense grayscale points are identified, and grayscale point equalization is performed according to the dense grayscale values ​​and dense grayscale frequencies to obtain a balanced dense grayscale value, wherein the balanced dense grayscale value is expressed as:

[0126]

[0127] Among them, H′ m Indicates balanced dense grayscale value, H m Represents dense grayscale value, H y Represents the original maximum grayscale value, H h Indicates the maximum gray value of equilibrium;

[0128] The dense grayscale points are updated by using the balanced dense grayscale values ​​to obtain balanced dense points, and the balanced dense points are summarized to obtain a balanced dense point set;

[0129] According to the balanced dense point set, grayscale balancing is performed on the sparse grayscale point set to obtain a balanced sparse point set;

[0130] The original grayscale image is updated using the balanced sparse point set and the balanced dense point set to obtain a grayscale animal image.

[0131] It should be explained that the original grayscale range refers to the range of grayscale values ​​in the original grayscale image, and the balanced grayscale range refers to the range of grayscale values ​​set artificially. The balanced grayscale range should be smaller than the original grayscale range. For example, the original grayscale range is 0 to 255, and the balanced grayscale range can be set to 0 to 100. The balanced dense point refers to a dense grayscale point whose grayscale value is a balanced dense grayscale value.

[0132] In detail, performing grayscale balancing on the sparse grayscale point set according to the balanced dense point set to obtain a balanced sparse point set includes:

[0133] Based on the balanced dense point set, a dense grayscale mean is calculated, wherein the dense grayscale mean is the average value of the grayscale values ​​of the balanced dense points in the balanced dense point set;

[0134] Extract sparse grayscale points in the sparse grayscale point set in sequence, identify sparse grayscale values ​​of the sparse grayscale points, and determine whether the sparse grayscale values ​​are greater than the dense grayscale mean value;

[0135] If the sparse grayscale value is greater than the dense grayscale mean value, the sparse grayscale point is updated using the balanced maximum grayscale value to obtain a balanced sparse point;

[0136] If the sparse grayscale value is not greater than the dense grayscale mean value, the sparse grayscale point is updated using the balanced minimum grayscale value to obtain a balanced sparse point;

[0137] The balanced sparse points are aggregated to obtain a balanced sparse point set.

[0138] It can be understood that the dense grayscale mean refers to the average value of the grayscale values ​​of the balanced dense points in the balanced dense point set, which is used to divide the sparse grayscale values. The sparse grayscale values ​​refer to the grayscale values ​​corresponding to the sparse grayscale points.

[0139] S4. Perform contour recognition in the grayscale animal image to obtain a grayscale animal contour, identify a grayscale contour area of ​​the grayscale animal contour, and record the grayscale contour area as a target contour feature value.

[0140] It can be understood that the grayscale animal contour refers to the contour in the grayscale animal image used to represent the appearance of the animal, and the grayscale contour area refers to the area ratio of the grayscale animal contour in the grayscale animal image.

[0141] It should be explained that edge detection can be performed in grayscale animal images through an edge detection algorithm, and the detection of grayscale animal contours can be completed through a contour extraction algorithm. Among them, edge detection algorithms include: Canny edge detection, Sobel edge detection and Laplacian edge detection, etc., and contour extraction algorithms include: findContours function in the OpenCV library. The above methods have been widely used in practical applications and will not be described in detail here.

[0142] S5. Perform animal grayscale feature recognition based on the grayscale animal image to obtain a target grayscale feature value group.

[0143] It can be understood that the target grayscale feature value group refers to a set of numerical values ​​used to represent the grayscale features in the grayscale animal image, and the target grayscale feature value group will be used in the subsequent training of the deep learning model.

[0144] In detail, the grayscale feature recognition of animals is performed based on the grayscale animal image to obtain a target grayscale feature value group, including:

[0145] Setting a neighborhood step length, sequentially extracting grayscale pixels in the grayscale animal image, performing neighborhood extraction on the grayscale pixels based on the neighborhood step length to obtain a neighborhood pixel point group, and identifying a neighborhood grayscale value group of the neighborhood pixel point group;

[0146] A neighborhood pixel matrix is ​​constructed according to the neighborhood gray value group, wherein the neighborhood pixel matrix is ​​expressed as:

[0147]

[0148] Among them, H lrepresents the neighborhood pixel matrix, i represents the horizontal coordinate of the grayscale pixel, j represents the vertical coordinate of the grayscale pixel, d represents the neighborhood step size, H i+d,j Indicates the neighborhood grayscale value corresponding to the neighborhood pixel point with coordinates (i+d,j), H i-d,j Indicates the neighborhood grayscale value corresponding to the neighborhood pixel point with coordinates (id, j), H i,j+d Indicates the neighborhood grayscale value corresponding to the neighborhood pixel point with coordinates (i, j+d), H i,j-d Indicates the neighborhood grayscale value corresponding to the neighborhood pixel point with coordinates (i, jd);

[0149] According to the neighborhood pixel matrix, the pixel deviation value and pixel deviation angle are calculated using the following formula:

[0150]

[0151] Wherein, ΔH represents the pixel deviation value, |*| represents the absolute value sign, F represents the pixel deviation angle, and arctan(*) represents the inverse tangent sign;

[0152] Grayscale feature calculation is performed according to the pixel deviation value and the pixel deviation angle to obtain a target grayscale feature value group.

[0153] It can be understood that the neighborhood step size refers to a constant artificially set to represent the distance between a pixel point and surrounding pixels, the grayscale pixel point refers to a pixel point in a grayscale animal image, the neighborhood pixel point refers to a pixel point that is at a distance d from the grayscale pixel point, wherein d represents the neighborhood step size, the neighborhood grayscale value refers to the grayscale value of the neighborhood pixel point, the neighborhood pixel point matrix refers to a matrix constructed based on the neighborhood pixel value, which represents the grayscale change relationship between the grayscale pixel point and the neighborhood pixel point, the pixel deviation value refers to a numerical value used to represent the grayscale value difference between neighborhood pixels, the pixel deviation angle refers to a numerical value used to represent the degree of deviation of the grayscale value between the neighborhood pixel point and the grayscale pixel point, and the greater the pixel deviation angle deviates from 0 degrees, the greater the degree of deviation between the current neighborhood pixel point and the grayscale pixel point.

[0154] In detail, the grayscale feature calculation is performed according to the pixel deviation value and the pixel deviation angle to obtain a target grayscale feature value group, including:

[0155] Determining whether the pixel deviation angle is greater than a preset standard deviation angle;

[0156] If the pixel deviation angle is greater than the standard deviation angle, the grayscale pixel point is recorded as a characteristic pixel point, the characteristic grayscale value of the characteristic pixel point is identified, and the deviation characteristic value is calculated based on the characteristic grayscale value, the pixel deviation value and the pixel deviation angle, wherein the deviation characteristic value is expressed as:

[0157] P=H t×cos(F)+ΔH

[0158] Among them, P represents the deviation eigenvalue, H t represents the characteristic gray value, cos(*) represents the cosine function;

[0159] Summarizing the deviation eigenvalues ​​to obtain a deviation eigenvalue set, and identifying an average deviation eigenvalue, a maximum deviation eigenvalue, a minimum deviation eigenvalue, and a median deviation eigenvalue in the deviation eigenvalue set;

[0160] The average deviation eigenvalue, the maximum deviation eigenvalue, the minimum deviation eigenvalue and the median deviation eigenvalue are key-paired to obtain a target grayscale eigenvalue group.

[0161] It should be explained that the standard deviation angle refers to the artificially set pixel deviation angle, and the standard deviation angle should be a smaller value, for example: 5 degrees. The characteristic grayscale value refers to the grayscale value of the characteristic pixel point. The deviation characteristic value refers to the value used to represent the grayscale characteristics of the grayscale pixel point. The average deviation characteristic value refers to the average in the deviation characteristic value set. The maximum deviation characteristic value and the minimum deviation characteristic value respectively refer to the maximum value and the minimum value in the deviation characteristic value set. The median deviation characteristic value refers to the median in the deviation characteristic value set.

[0162] S6. Key-pair the target animal ID, target contour feature value, and target grayscale feature value group to obtain a target animal feature group, and summarize the target animal feature group to obtain a target animal feature group set.

[0163] It should be explained that the target animal feature group refers to a group of animal features used to represent the target animal ID. Since the target animal feature group marks the target animal ID, the target animal feature group can be used to train a deep learning model to obtain a target animal identification model that can identify the target animal ID.

[0164] S7. Construct an animal recognition model based on the target animal feature set to obtain a target animal recognition model, wherein the target animal recognition model is a deep learning model trained with the target animal feature set.

[0165] It can be understood that the target animal recognition model can identify animals in images under specific environments. It is constructed as follows: the target animal feature set is divided into a training set, a verification set and a test set, wherein the training set is used to train the selected deep learning model, the verification set is used to verify the model at the training stage to prevent the model from overfitting, and the test set is used to test the performance of the deep learning model. The selected deep learning model is trained, verified and tested by the training set, verification set and test set respectively to obtain the target animal recognition model, wherein the deep learning model can be selected from: convolutional neural network model, etc.

[0166] It should be explained that after the acquired target animal feature group is input into the trained target animal recognition model, the target animal recognition model will output an animal ID and a recognition success rate, through which the input target animal feature group can be judged.

[0167] S8. Perform multi-target recognition on the to-be-recognized animal image using a target animal recognition model to obtain a multi-target animal image, thereby completing multi-target recognition based on animal image features.

[0168] It can be understood that the multi-target animal image refers to an animal image to be identified after multi-target animal identification, and the animal outlines in the multi-target animal image will be marked with the corresponding target animal ID.

[0169] In detail, the method of performing multi-target recognition on the to-be-recognized animal image using the target animal recognition model to obtain the multi-target animal image includes:

[0170] The image ratio of the animal image to be identified is obtained, and a plurality of mobile identification blocks are set according to the image ratio of the animal image to be identified and the standard image ratio, wherein the image ratio of the mobile identification block is the standard image ratio, and the number of the mobile identification blocks is:

[0171]

[0172] Where n′ represents the number of mobile identification blocks, Z(*) represents the upward rounding function, and C s Indicates the ratio of the image to be recognized, C b Indicates the standard image ratio;

[0173] Identify the upper left vertex of the image of the animal to be identified, record the upper left vertex as the block movement starting point, and add the multiple mobile identification blocks to the image of the animal to be identified based on the block movement starting point to obtain a block animal image, wherein the multiple mobile identification blocks are arranged in sequence from top to bottom on the left side of the image of the animal to be identified, and there is no spatial overlap between different mobile identification blocks;

[0174] Identify the right side of the animal image in the block, and record the right side as the moving terminal side of the block;

[0175] Record the current movement start time, and according to the movement start time and the preset block movement speed, use the multiple movement identification blocks to move right in the block animal image to obtain an intercepted animal region set, wherein the intercepted animal region in the intercepted animal region set corresponds to the movement identification block in the multiple movement identification blocks;

[0176] The intercepted animal regions are sequentially extracted from the intercepted animal region set, and the following operations are performed on the intercepted animal regions:

[0177] Obtaining an intercepted animal feature group of the intercepted animal region, wherein the intercepted animal feature group includes: an intercepted contour feature value and an intercepted grayscale feature value group, wherein the intercepted contour feature value is an area ratio of the intercepted animal contour in the intercepted animal region;

[0178] Inputting the intercepted animal feature group into the target animal recognition model to obtain a candidate animal ID and a candidate animal similarity, and determining whether the candidate animal similarity is greater than a preset standard animal similarity;

[0179] If the candidate animal similarity is greater than the standard animal similarity, the candidate animal ID is recorded as the identification animal ID, and the intercepted animal outline in the intercepted animal area is identified by using the identification animal ID to obtain the identified animal area;

[0180] Summarize the identified animal areas to obtain an identified animal area group, and return to the step of recording the current movement start time until the movement identification block contacts the block movement terminal edge;

[0181] The identified animal region groups are summarized to obtain an identified animal region set, and multi-target recognition is performed on the animal image to be identified based on the identified animal region set to obtain a multi-target animal image.

[0182] It can be understood that the scale of the image to be identified refers to the scale size when the image of the animal to be identified is taken, the moving identification block refers to a rectangular area with a size of the standard image scale, the movement start time refers to the current time when the moving identification block starts to move, the block movement speed refers to an artificially set constant, the intercepted animal area refers to the animal image to be identified selected by the moving identification block, the intercepted animal feature group refers to a numerical value used to represent the animal features in the intercepted animal area, which includes: an intercepted contour feature value and an intercepted grayscale feature value group, wherein the intercepted contour feature value is the ratio of the area occupied by the intercepted animal contour in the intercepted animal area, and the intercepted grayscale feature value group refers to a numerical group used to represent the grayscale features of the intercepted animal area, and its calculation method is the same as the calculation method of the target grayscale feature value group of the grayscale animal image, which will not be repeated here.

[0183] It can be understood that the candidate animal ID refers to the target animal ID obtained after identification by the target animal identification model, the candidate animal similarity refers to the accuracy of this identification obtained after identification by the target animal identification model, the standard animal similarity refers to the artificially set animal similarity, and the identified animal area refers to the intercepted animal area after the identification animal ID mark.

[0184] In detail, the method of performing multi-target recognition on the animal image to be recognized according to the identified animal region set to obtain the multi-target animal image includes:

[0185] Extracting identified animal regions in sequence from the identified animal region set, and identifying a region group of animals of the same family as the identified animal region in the identified animal region set, wherein the ID of the same family animal in the region of the same family is the same as the ID of the identified animal in the identified animal region;

[0186] Sequentially extracting animal regions of the same species from the same species animal region group, and determining whether the identified animal region is connected to the same species animal region;

[0187] If the marked animal region is connected to the region of animals of the same species, the marked animal region and the region of animals of the same species are merged to obtain a merged animal region;

[0188] Summarizing the merged animal regions to obtain a merged animal region set, using the merged animal region set to update the identified animal region set, and returning to the step of sequentially extracting identified animal regions from the identified animal region set until there is no region group of animals of the same family in the identified animal region set;

[0189] The image of the animal to be identified is updated using the merged animal region set to obtain a multi-target animal image.

[0190] It should be explained that the same-family animal area group refers to the identified animal area in the identified animal area set that has the same identification animal ID mark as the identified animal area, and the merged animal area refers to the merged area of ​​the identified animal area and the connected same-family animal areas.

[0191] In order to solve the problems described in the background technology, the present invention first obtains an animal image to be identified, and sets a target animal ID set according to the animal image to be identified. This step determines the animal species that may be contained in the animal image to be identified, and sets the target animal ID set accordingly, which provides a clear goal and direction for the subsequent identification process and improves the pertinence and accuracy of the identification. Then, an animal standard image query is performed based on the target animal ID set to obtain a target animal image group set. By performing the animal standard image query, a reference benchmark can be established for the animal image to be identified, ensuring that there is a reliable control group in the identification process, thereby improving the accuracy of the identification. Then, the target animal image group set is standardized in image size to obtain a standard animal image group set. The standardized image size can eliminate the influence of different image sizes on subsequent multi-target identification, ensuring that the target animal identification model can consistently process images of various sizes. Next, the target animal ID is extracted in sequence from the target animal ID set. Based on the target animal ID, an image group of the same family of animals is identified in the standard animal image group set. In the same family of animals image group, images of the same family of animals are extracted in sequence, and the images of the same family of animals are grayed out to obtain grayscale animal images. Graying can reduce the impact of lighting conditions on image recognition and make the morphological features in animal images more prominent, so as to facilitate the subsequent identification of animal features. Furthermore, contour recognition is performed in the grayscale animal image to obtain the grayscale animal contour, the grayscale contour area of ​​the grayscale animal contour is identified, and the grayscale contour area is recorded as the target contour feature value. Animal grayscale feature recognition is performed based on the grayscale animal image to obtain a target grayscale feature value group. This step extracts the animal feature value in the grayscale animal image, which provides basic data for the subsequent training of the deep learning model. Then, the target animal ID, the target contour feature value and the target grayscale feature value group are key-paired to obtain a target animal feature group. The target animal feature group is summarized to obtain a target animal feature group set, and an animal recognition model is constructed based on the target animal feature group set to obtain a target animal recognition model. The construction of the target animal recognition model can realize the automatic multi-target recognition of animal images in a specific environment, reducing the excessive consumption of time and human resources. Finally, the target animal recognition model is used to perform multi-target recognition on the animal image to be identified to obtain a multi-target animal image, thereby completing multi-target recognition based on animal image features. Therefore, the present invention can improve the accuracy of multi-target recognition of animal images and reduce excessive consumption of time and human resources.

[0192] like Figure 2 , which is a functional module diagram of a multi-target recognition system based on animal image features provided by an embodiment of the present invention.

[0193] The multi-target recognition system 100 based on animal image features of the present invention can be installed in an electronic device. According to the functions to be implemented, the multi-target recognition system 100 based on animal image features can include an animal image acquisition module 101, a grayscale image conversion module 102, an animal feature calculation module 103 and a recognition model construction module 104. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.

[0194] The animal image acquisition module 101 is used to acquire an animal image to be identified, set a target animal ID set according to the animal image to be identified, perform an animal standard image query based on the target animal ID set, and obtain a target animal image group set, wherein each target animal ID in the target animal ID set corresponds to a target animal image group in the target animal image group set, and the animal image to be identified includes animal images corresponding to multiple target animal IDs;

[0195] The grayscale image conversion module 102 is used to standardize the image size of the target animal image set to obtain a standard animal image set, sequentially extract the target animal ID from the target animal ID set, identify the same family animal image set in the standard animal image set based on the target animal ID, sequentially extract the same family animal images from the same family animal image set, and perform balanced grayscale conversion on the same family animal images to obtain grayscale animal images;

[0196] The animal feature calculation module 103 is used to perform contour recognition in the grayscale animal image to obtain the grayscale animal contour, identify the grayscale contour area of ​​the grayscale animal contour, record the grayscale contour area as the target contour feature value, perform animal grayscale feature recognition based on the grayscale animal image to obtain a target grayscale feature value group, perform key-value pairing on the target animal ID, the target contour feature value and the target grayscale feature value group to obtain a target animal feature group, and summarize the target animal feature group to obtain a target animal feature group set;

[0197] The recognition model construction module 104 is used to construct an animal recognition model based on the target animal feature set to obtain a target animal recognition model, wherein the target animal recognition model is a deep learning model trained with the target animal feature set, and the target animal recognition model is used to perform multi-target recognition on the animal image to be identified to obtain a multi-target animal image.

[0198] In detail, the modules in the multi-target recognition system 100 based on animal image features in the embodiment of the present invention are used in the same manner as described above. Figure 1The multi-target recognition method based on animal image features described in the invention has the same technical means and can produce the same technical effects, so it will not be repeated here.

[0199] like Figure 3 FIG. 1 is a schematic diagram of the structure of an electronic device for implementing a multi-target recognition method based on animal image features provided by an embodiment of the present invention.

[0200] The electronic device 1 may include a processor 10, a memory 11 and a bus 12, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a multi-target recognition method program based on animal image features.

[0201] Wherein, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. The memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, such as a mobile hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 11 also includes an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device 1, such as the code of the multi-target recognition method program based on animal image features, but also be used to temporarily store data that has been output or is to be output.

[0202] The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the memory 11 (such as a multi-target recognition method program based on animal image features, etc.), and calls data stored in the memory 11 to execute various functions of the electronic device 1 and process data.

[0203] The bus 12 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus 12 may be divided into an address bus, a data bus, a control bus, etc. The bus 12 is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.

[0204] Figure 3 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 3 The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0205] For example, although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management system, so that the power management system can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators. The electronic device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0206] Furthermore, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device 1 and other electronic devices.

[0207] Optionally, the electronic device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual user interface.

[0208] The multi-target recognition method program based on animal image features stored in the memory 11 of the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can achieve:

[0209] Acquire an animal image to be identified, set a target animal ID set according to the animal image to be identified, perform an animal standard image query based on the target animal ID set, and obtain a target animal image group set, wherein each target animal ID in the target animal ID set corresponds to a target animal image group in the target animal image group set, and the animal image to be identified includes animal images corresponding to multiple target animal IDs;

[0210] Standardizing the image size of the target animal image set to obtain a standard animal image set, extracting target animal IDs in the target animal ID set in sequence, and identifying a group of images of animals of the same species in the standard animal image set based on the target animal IDs;

[0211] Extracting the same-family animal images in sequence from the same-family animal image group, performing balanced grayscale conversion on the same-family animal images, and obtaining grayscale animal images;

[0212] Performing contour recognition in the grayscale animal image to obtain a grayscale animal contour, identifying a grayscale contour area of ​​the grayscale animal contour, and recording the grayscale contour area as a target contour feature value;

[0213] Perform animal grayscale feature recognition based on the grayscale animal image to obtain a target grayscale feature value group;

[0214] Key-pairing the target animal ID, target contour feature value and target grayscale feature value group to obtain a target animal feature group, and summarizing the target animal feature group to obtain a target animal feature group set;

[0215] An animal recognition model is constructed based on the target animal feature set to obtain a target animal recognition model, wherein the target animal recognition model is a deep learning model trained with the target animal feature set;

[0216] The target animal recognition model is used to perform multi-target recognition on the animal image to be recognized, to obtain multi-target animal images, and to complete multi-target recognition based on animal image features.

[0217] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to Figures 1 to 3 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0218] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or system that can carry the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

[0219] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:

[0220] Acquire an animal image to be identified, set a target animal ID set according to the animal image to be identified, perform an animal standard image query based on the target animal ID set, and obtain a target animal image group set, wherein each target animal ID in the target animal ID set corresponds to a target animal image group in the target animal image group set, and the animal image to be identified includes animal images corresponding to multiple target animal IDs;

[0221] Standardizing the image size of the target animal image set to obtain a standard animal image set, extracting target animal IDs in the target animal ID set in sequence, and identifying a group of images of animals of the same species in the standard animal image set based on the target animal IDs;

[0222] Extracting the same-family animal images in sequence from the same-family animal image group, performing balanced grayscale conversion on the same-family animal images, and obtaining grayscale animal images;

[0223] Performing contour recognition in the grayscale animal image to obtain a grayscale animal contour, identifying a grayscale contour area of ​​the grayscale animal contour, and recording the grayscale contour area as a target contour feature value;

[0224] Perform animal grayscale feature recognition based on the grayscale animal image to obtain a target grayscale feature value group;

[0225] Key-pairing the target animal ID, target contour feature value, and target grayscale feature value group to obtain a target animal feature group, and summarizing the target animal feature group to obtain a target animal feature group set;

[0226] An animal recognition model is constructed based on the target animal feature set to obtain a target animal recognition model, wherein the target animal recognition model is a deep learning model trained with the target animal feature set;

[0227] The target animal recognition model is used to perform multi-target recognition on the animal image to be recognized, to obtain multi-target animal images, and to complete multi-target recognition based on animal image features.

[0228] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, systems and methods can be implemented in other ways. For example, the system embodiments described above are only illustrative, and actual implementation may have other division methods.

[0229] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0230] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0231] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0232] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A multi-target recognition method based on animal image features, characterized in that: The method comprises: Acquire an animal image to be identified, set a target animal ID set according to the animal image to be identified, perform an animal standard image query based on the target animal ID set, and obtain a target animal image group set, wherein each target animal ID in the target animal ID set corresponds to a target animal image group in the target animal image group set, and the animal image to be identified includes animal images corresponding to multiple target animal IDs; Standardizing the image size of the target animal image set to obtain a standard animal image set, extracting target animal IDs in the target animal ID set in sequence, and identifying a group of images of animals of the same species in the standard animal image set based on the target animal IDs; Extracting the same-family animal images in sequence from the same-family animal image group, performing balanced grayscale conversion on the same-family animal images, and obtaining grayscale animal images; Performing contour recognition in the grayscale animal image to obtain a grayscale animal contour, identifying a grayscale contour area of ​​the grayscale animal contour, and recording the grayscale contour area as a target contour feature value; Perform animal grayscale feature recognition based on the grayscale animal image to obtain a target grayscale feature value group; Key-pairing the target animal ID, target contour feature value and target grayscale feature value group to obtain a target animal feature group, and summarizing the target animal feature group to obtain a target animal feature group set; An animal recognition model is constructed based on the target animal feature set to obtain a target animal recognition model, wherein the target animal recognition model is a deep learning model trained with the target animal feature set; The target animal recognition model is used to perform multi-target recognition on the animal image to be recognized, to obtain multi-target animal images, and to complete multi-target recognition based on animal image features.

2. The multi-target recognition method based on animal image features as claimed in claim 1, characterized in that: The step of normalizing the image size of the target animal image set to obtain a standard animal image set includes: Extracting target animal images in sequence from the target animal image set, and obtaining original image ratios of the target animal images; Scaling the target animal image according to the original image ratio and the preset standard image ratio to obtain a standard animal image; The standard animal images are aggregated to obtain a standard animal image set, and the target animal image set is updated using the standard animal image set to obtain a standard animal image set.

3. The multi-target recognition method based on animal image features as claimed in claim 2, characterized in that: The step of performing balanced grayscale conversion on the images of animals of the same species to obtain grayscale animal images includes: Graying the image of the same species animal to obtain an original grayscale image, wherein graying refers to converting the color space of the image of the same species animal from RGB space to grayscale space; Extracting original grayscale points in the original grayscale image in sequence, identifying original grayscale values ​​of the original grayscale points, and summarizing the original grayscale values ​​to obtain an original grayscale value set; Performing frequency statistics on the original grayscale value set to obtain an original grayscale frequency set, wherein the original grayscale frequencies in the original grayscale frequency set are arranged in ascending order; The original grayscale frequencies are sequentially extracted from the original grayscale frequency set, and the frequency proportions of the original grayscale frequencies are calculated, wherein the frequency proportions are expressed as: Among them, Q represents the frequency proportion, n represents the number of original grayscale frequencies in the original grayscale frequency set, and L i represents the i-th original grayscale frequency, L represents the original grayscale frequency; Determining whether the frequency weight is greater than a preset standard weight; If the frequency weight is greater than the standard weight, the frequency weight is recorded as a dense weight, and a plurality of dense grayscale points of the dense weight are identified; If the frequency weight is not greater than the standard weight, the frequency weight is recorded as a sparse weight, and a plurality of sparse grayscale points of the sparse weight are identified; The plurality of dense grayscale points and the plurality of sparse grayscale points are respectively summarized to obtain a dense grayscale point set and a sparse grayscale point set, and grayscale enhancement is performed on the original grayscale image according to the dense grayscale point set and the sparse grayscale point set to obtain a grayscale animal image.

4. The multi-target recognition method based on animal image features as claimed in claim 3, characterized in that: The grayscale enhancement of the original grayscale image according to the dense grayscale point set and the sparse grayscale point set to obtain a grayscale animal image includes: Acquire an original grayscale range of the original grayscale image, wherein the original grayscale range includes an original minimum grayscale value and an original maximum grayscale value, and the original minimum grayscale value is 0; Setting a balanced grayscale range, wherein the balanced grayscale range includes: a balanced minimum grayscale value and a balanced maximum grayscale value, and the balanced minimum grayscale value is 0; Dense grayscale points are sequentially extracted from the dense grayscale point set, dense grayscale values ​​and dense grayscale frequencies of the dense grayscale points are identified, and grayscale point equalization is performed according to the dense grayscale values ​​and dense grayscale frequencies to obtain a balanced dense grayscale value, wherein the balanced dense grayscale value is expressed as: Among them, H′ m Indicates balanced dense grayscale value, H m Represents dense grayscale value, H y Represents the original maximum grayscale value, H h Indicates the maximum gray value of equilibrium; The dense grayscale points are updated by using the balanced dense grayscale values ​​to obtain balanced dense points, and the balanced dense points are summarized to obtain a balanced dense point set; According to the balanced dense point set, grayscale balancing is performed on the sparse grayscale point set to obtain a balanced sparse point set; The original grayscale image is updated using the balanced sparse point set and the balanced dense point set to obtain a grayscale animal image.

5. The multi-target recognition method based on animal image features as claimed in claim 4, characterized in that: The step of performing grayscale balancing on the sparse grayscale point set according to the balanced dense point set to obtain a balanced sparse point set includes: Based on the balanced dense point set, a dense grayscale mean is calculated, wherein the dense grayscale mean is the average value of the grayscale values ​​of the balanced dense points in the balanced dense point set; Extract sparse grayscale points in the sparse grayscale point set in sequence, identify sparse grayscale values ​​of the sparse grayscale points, and determine whether the sparse grayscale values ​​are greater than the dense grayscale mean value; If the sparse grayscale value is greater than the dense grayscale mean value, the sparse grayscale point is updated using the balanced maximum grayscale value to obtain a balanced sparse point; If the sparse grayscale value is not greater than the dense grayscale mean value, the sparse grayscale point is updated using the balanced minimum grayscale value to obtain a balanced sparse point; The balanced sparse points are aggregated to obtain a balanced sparse point set.

6. The multi-target recognition method based on animal image features as claimed in claim 5, characterized in that: The step of performing animal grayscale feature recognition according to the grayscale animal image to obtain a target grayscale feature value group includes: Setting a neighborhood step length, sequentially extracting grayscale pixels in the grayscale animal image, performing neighborhood extraction on the grayscale pixels based on the neighborhood step length to obtain a neighborhood pixel point group, and identifying a neighborhood grayscale value group of the neighborhood pixel point group; A neighborhood pixel matrix is ​​constructed according to the neighborhood gray value group, wherein the neighborhood pixel matrix is ​​expressed as: Among them, H l represents the neighborhood pixel matrix, i represents the horizontal coordinate of the grayscale pixel, j represents the vertical coordinate of the grayscale pixel, d represents the neighborhood step size, H i+d,j Indicates the neighborhood grayscale value corresponding to the neighborhood pixel point with coordinates (i+d,j), H i-d,j Indicates the neighborhood grayscale value corresponding to the neighborhood pixel point with coordinates (id, j), H i,j+d Indicates the neighborhood grayscale value corresponding to the neighborhood pixel point with coordinates (i, j+d), H i,j-d Indicates the neighborhood grayscale value corresponding to the neighborhood pixel point with coordinates (i, jd); According to the neighborhood pixel matrix, the pixel deviation value and pixel deviation angle are calculated using the following formula: Wherein, ΔH represents the pixel deviation value, |*| represents the absolute value sign, * represents the pixel deviation angle, and arctan(*) represents the inverse tangent sign; Grayscale feature calculation is performed according to the pixel deviation value and the pixel deviation angle to obtain a target grayscale feature value group.

7. The multi-target recognition method based on animal image features as claimed in claim 6, characterized in that: The grayscale feature calculation is performed according to the pixel deviation value and the pixel deviation angle to obtain a target grayscale feature value group, including: Determining whether the pixel deviation angle is greater than a preset standard deviation angle; If the pixel deviation angle is greater than the standard deviation angle, the grayscale pixel point is recorded as a characteristic pixel point, the characteristic grayscale value of the characteristic pixel point is identified, and the deviation characteristic value is calculated based on the characteristic grayscale value, the pixel deviation value and the pixel deviation angle, wherein the deviation characteristic value is expressed as: P=H t ×cos(F)+ΔH Among them, P represents the deviation eigenvalue, H t represents the characteristic gray value, cos(*) represents the cosine function; Summarizing the deviation eigenvalues ​​to obtain a deviation eigenvalue set, and identifying an average deviation eigenvalue, a maximum deviation eigenvalue, a minimum deviation eigenvalue, and a median deviation eigenvalue in the deviation eigenvalue set; The average deviation eigenvalue, the maximum deviation eigenvalue, the minimum deviation eigenvalue and the median deviation eigenvalue are key-paired to obtain a target grayscale eigenvalue group.

8. The multi-target recognition method based on animal image features as claimed in claim 7, characterized in that: The method of performing multi-target recognition on the to-be-recognized animal image using the target animal recognition model to obtain the multi-target animal image comprises: The image ratio of the animal image to be identified is obtained, and a plurality of mobile identification blocks are set according to the image ratio of the animal image to be identified and the standard image ratio, wherein the image ratio of the mobile identification block is the standard image ratio, and the number of the mobile identification blocks is: Where n′ represents the number of mobile identification blocks, Z(*) represents the upward rounding function, and C s Indicates the ratio of the image to be recognized, C b Indicates the standard image ratio; Identify the upper left vertex of the image of the animal to be identified, record the upper left vertex as the block movement starting point, and add the multiple mobile identification blocks to the image of the animal to be identified based on the block movement starting point to obtain a block animal image, wherein the multiple mobile identification blocks are arranged in sequence from top to bottom on the left side of the image of the animal to be identified, and there is no spatial overlap between different mobile identification blocks; Identify the right side of the animal image in the block, and record the right side as the moving terminal side of the block; Record the current movement start time, and according to the movement start time and the preset block movement speed, use the multiple movement identification blocks to move right in the block animal image to obtain an intercepted animal region set, wherein the intercepted animal region in the intercepted animal region set corresponds to the movement identification block in the multiple movement identification blocks; The intercepted animal regions are sequentially extracted from the intercepted animal region set, and the following operations are performed on the intercepted animal regions: Obtaining an intercepted animal feature group of the intercepted animal region, wherein the intercepted animal feature group includes: an intercepted contour feature value and an intercepted grayscale feature value group, wherein the intercepted contour feature value is an area ratio of the intercepted animal contour in the intercepted animal region; Inputting the intercepted animal feature group into the target animal recognition model to obtain a candidate animal ID and a candidate animal similarity, and determining whether the candidate animal similarity is greater than a preset standard animal similarity; If the candidate animal similarity is greater than the standard animal similarity, the candidate animal ID is recorded as the identification animal ID, and the intercepted animal outline in the intercepted animal area is identified by using the identification animal ID to obtain the identified animal area; Summarize the identified animal areas to obtain an identified animal area group, and return to the step of recording the current movement start time until the movement identification block contacts the block movement terminal edge; The identified animal region groups are summarized to obtain an identified animal region set, and multi-target recognition is performed on the animal image to be identified based on the identified animal region set to obtain a multi-target animal image.

9. The multi-target recognition method based on animal image features as claimed in claim 8, characterized in that: The step of performing multi-target recognition on the animal image to be recognized according to the identified animal region set to obtain a multi-target animal image comprises: Extracting identified animal regions in sequence from the identified animal region set, and identifying a region group of animals of the same family as the identified animal region in the identified animal region set, wherein the ID of the same family animal in the region of the same family is the same as the ID of the identified animal in the identified animal region; Sequentially extracting animal regions of the same species from the same species animal region group, and determining whether the identified animal region is connected to the same species animal region; If the marked animal region is connected to the region of animals of the same species, the marked animal region and the region of animals of the same species are merged to obtain a merged animal region; Summarizing the merged animal regions to obtain a merged animal region set, using the merged animal region set to update the identified animal region set, and returning to the step of sequentially extracting identified animal regions from the identified animal region set until there is no region group of animals of the same family in the identified animal region set; The image of the animal to be identified is updated using the merged animal region set to obtain a multi-target animal image.

10. A multi-target recognition system based on animal image features, characterized in that: The system comprises: An animal image acquisition module is used to acquire an animal image to be identified, set a target animal ID set according to the animal image to be identified, perform an animal standard image query based on the target animal ID set, and obtain a target animal image group set, wherein each target animal ID in the target animal ID set corresponds to a target animal image group in the target animal image group set, and the animal image to be identified includes animal images corresponding to multiple target animal IDs; A grayscale image conversion module is used to standardize the image size of the target animal image set to obtain a standard animal image set, sequentially extract the target animal ID from the target animal ID set, identify the same family animal image set in the standard animal image set based on the target animal ID, sequentially extract the same family animal images from the same family animal image set, and perform balanced grayscale conversion on the same family animal images to obtain grayscale animal images; An animal feature calculation module is used to perform contour recognition in the grayscale animal image to obtain a grayscale animal contour, identify the grayscale contour area of ​​the grayscale animal contour, record the grayscale contour area as a target contour feature value, perform animal grayscale feature recognition based on the grayscale animal image to obtain a target grayscale feature value group, perform key-value pairing on the target animal ID, the target contour feature value and the target grayscale feature value group to obtain a target animal feature group, and summarize the target animal feature group to obtain a target animal feature group set; The recognition model construction module is used to construct an animal recognition model based on the target animal feature set to obtain a target animal recognition model, wherein the target animal recognition model is a deep learning model trained with the target animal feature set, and the target animal recognition model is used to perform multi-target recognition on the animal images to be recognized to obtain multi-target animal images.

Citation Information

Patent Citations

  • Warehouse entry and exit identification method and device and computer readable storage medium

    CN114842223A

  • Image processing method, device and equipment and readable storage medium

    CN114998614A

  • Migrating bird monitoring and identifying method and device

    CN116704428A

  • Ai-based object classification method and apparatus, and medical imaging device and storage medium

    US20220189142A1

  • Method and device for recognizing image, storage medium and electronic device

    WO2020221177A1