A pet recipe generation method based on image recognition and related device
By acquiring pet images and extracting multi-scale features using residual networks to generate pet recipes, the problem of insufficient targeted and accurate pet recipes in the prior art is solved, and more targeted recipe generation is achieved.
Patent Information
- Application Number
- CN202111582666.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-22
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2041-12-22
AI Technical Summary
When feeding pets, the pet recipes in the prior art are not targeted and accurate, resulting in a single and untargeted feeding method.
By obtaining images of different parts of the target pet, using a pre-built residual network for feature extraction and multi-scale feature stitching, multiple feature information of the target pet are generated, thereby generating more targeted and accurate recipes.
Improve the pertinence and accuracy of pet recipes, ensure that the recipes are more in line with pet needs, and avoid the problem of too single ingredients.
Smart Images

Figure CN114464294B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a pet recipe generation method based on image recognition and related devices. Background Art
[0002] With the development of the times, raising pets has become one of the hobbies for people to get close to nature and meet human psychological needs. Raising pets can bring people happiness, but it can also bring people troubles. For example, when feeding pets, it is necessary to provide them with healthy and nutritious food. However, when feeding pets, many people search for pet recipes on the Internet, which is relatively simple and not targeted. Summary of the invention
[0003] The embodiments of the present application provide a pet recipe generation method and related devices based on image recognition to improve the pertinence and accuracy of pet recipes.
[0004] The first aspect of the present application provides a method for generating a pet recipe based on image recognition, comprising:
[0005] Acquire at least one image containing different parts of a target pet, each image including at least one part of the target pet;
[0006] Through the pre-built residual network, feature extraction is performed on each image, and the features extracted by convolutional layers of different depths are spliced to obtain a target feature map of each image;
[0007] splicing the target feature map of the at least one image as input data of the first network, so as to perform multi-task classification through the first network to obtain multiple feature information of the target pet;
[0008] A recipe for the target pet is generated based on multiple feature information of the target pet.
[0009] The second aspect of the present application provides a pet recipe generation device based on image recognition, the device comprising an acquisition module and a processing module.
[0010] The acquisition module is used to acquire at least one image containing different parts of the target pet, each image including at least one part of the target pet;
[0011] The processing module is used to extract features from each image through a pre-built residual network, and to splice features extracted from convolutional layers of different depths to obtain a target feature map for each image;
[0012] The processing module is further used to splice the target feature map of the at least one image as input data of the first network, so as to perform multi-task classification through the first network to obtain multiple feature information of the target pet;
[0013] The processing module is also used to generate a recipe for the target pet based on multiple feature information of the target pet.
[0014] The third aspect of the present application provides an electronic device for generating pet recipes based on image recognition, comprising a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and are generated to be executed by the processor to execute instructions for executing the steps of any one of the methods for generating pet recipes based on image recognition.
[0015] A fourth aspect of the present application provides a computer-readable storage medium, which is used to store a computer program, and the stored computer program is executed by the processor to implement any method described in a method for generating a pet recipe based on image recognition.
[0016] It can be seen that in the above technical solution, by obtaining at least one image containing different parts of the target pet, the feature extraction of each image can be performed through the pre-built residual network, and the features extracted by the convolutional layers of different depths are spliced to obtain the target feature map of each image, which increases the richness and comprehensiveness of the extracted features, so that when the target feature map of at least one image is spliced as the input data of the first network, the multi-task classification through the first network can be performed to obtain multiple feature information of the target pet more accurately, that is, the result of the multi-task classification is more accurate. At the same time, when the recipe of the target pet is generated according to the multiple feature information of the target pet, the pertinence and accuracy of the pet recipe are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] in:
[0019] Figure 1A is a schematic diagram of a pet recipe generation system based on image recognition provided in an embodiment of the present application;
[0020] Figure 1Bis a schematic diagram of another pet recipe generation system based on image recognition provided in an embodiment of the present application;
[0021] Figure 2 It is a flowchart of a method for generating a pet recipe based on image recognition provided in an embodiment of the present application;
[0022] Figure 3 is a schematic diagram of an MMOE network provided in an embodiment of the present application;
[0023] Figure 4 It is a flowchart of another method for generating a pet recipe based on image recognition provided in an embodiment of the present application;
[0024] Figure 5 A schematic diagram of a pet recipe generation device based on image recognition provided in an embodiment of the present application;
[0025] Figure 6 A schematic diagram of the electronic device structure of the hardware operating environment involved in the embodiments of the present application. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0027] The following are detailed descriptions of each.
[0028] The terms "first" and "second" in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0029] First, see Figure 1A , Figure 1A: is a schematic diagram of a pet recipe generation system based on image recognition provided in an embodiment of the present application. The pet recipe generation system 100 based on image recognition may include a pet recipe generation device 110 based on image recognition. The pet recipe generation device 110 based on image recognition is used to process and store status data, etc. The pet recipe generation system 100 based on image recognition may include an integrated single device or multiple devices. For the convenience of description, the present application will collectively refer to the pet recipe generation system 100 based on image recognition as an electronic device. Obviously, the electronic device may include various handheld devices with wireless communication functions, vehicle-mounted devices, wearable devices, computing devices or other processing devices connected to a wireless modem, as well as various forms of user equipment (UE), mobile stations (MS), terminal devices (terminal devices), etc.
[0030] See also Figure 1B , Figure 1B FIG. 1 is a schematic diagram of another pet recipe generation system based on image recognition provided by an embodiment of the present application. Figure 1B As shown, the communication system may include a server and multiple electronic devices ( Figure 1B The server can communicate wirelessly with the electronic device.
[0031] in, Figure 1A and Figure 1B It is only a schematic diagram and does not constitute a limitation on the applicable scenarios of the technical solution provided in this application.
[0032] See also Figure 2 , Figure 2 is a flow chart of a method for generating a pet recipe based on image recognition provided by an embodiment of the present application. The method for generating a pet recipe based on image recognition can be applied to electronic devices, such as Figure 2 As shown, the method includes:
[0033] 201. Acquire at least one image containing different parts of a target pet, each image including at least one part of the target pet.
[0034] Among them, at least one image may include at least one of the following: a front view, a palm print view, left and right side views, a tail view, a back view, and a belly view of the target pet, without limitation.
[0035] A part of a target pet may include one of the following: eyes, nose, ears, mouth, teeth, back, tail, abdomen, paws, and toenails of the target pet, without limitation.
[0036] In this application, the category of the target pet is not limited. For example, the target pet can be a cat, dog, pig, duck, etc., which is not limited here.
[0037] Optionally, step 201 may include: displaying an image upload interface, the image upload interface including an image upload area and an image upload control; and acquiring at least one image from the image upload area in response to an upload operation on the image upload control.
[0038] The image upload interface may further include an image upload prompt area, which is used to display image upload prompt information, and the image upload prompt information is the preset requirements that the image uploaded by the user needs to meet. The preset requirements may include at least one of the following: size, resolution, etc., which are not limited here.
[0039] 202. Through the pre-built residual network, feature extraction is performed on each image, and the features extracted by convolutional layers of different depths are spliced to obtain the target feature map of each image.
[0040] Among them, the residual network is a type of convolutional neural network, which is easy to optimize and can improve accuracy by increasing the depth. The residual blocks inside the residual network use skip connections, which alleviates the gradient vanishing problem caused by increasing the depth in the deep neural network.
[0041] Optionally, the convolutional layer in the residual network is used to extract multi-scale features in each image, wherein features of different scales reflect different feature maps. Specifically, the multi-scale features in each image include a shallower feature map and a deeper feature map of at least one part of the target pet, the shallower feature map includes at least one of the following: hair color information, hair diameter information, and hair length information of at least one part of the target pet, and the deeper feature map includes at least one of the following: hair sparseness information, dandruff residue information, and oil smudge information of at least one part of the target pet.
[0042] By extracting features from each image through a residual network, on the one hand, the computational cost can be reduced, and the gradient vanishing problem caused by increasing the depth of a deep neural network can be alleviated. On the other hand, multi-scale features in each image can be effectively obtained, which increases the richness and comprehensiveness of the extracted features, thereby making the results of multi-task classification more accurate.
[0043] Optionally, before step 202, the present solution may further include: preprocessing each image to obtain each preprocessed image. It is understandable that, by using a pre-built residual network, feature extraction is performed on each image, and features extracted by convolutional layers of different depths are spliced to obtain a target feature map of each image, which may include: by using a pre-built residual network, feature extraction is performed on each preprocessed image, and features extracted by convolutional layers of different depths are spliced to obtain a target feature map of each image.
[0044] Optionally, performing a preset process on each image to obtain each preprocessed image may include: performing image correction on each image, performing contrast enhancement processing after correction to obtain each preprocessed image. The image correction includes image tilt correction and / or image brightness correction.
[0045] 203. Concatenate the target feature map of at least one image as input data of the first network, so as to perform multi-task classification through the first network to obtain multiple feature information of the target pet.
[0046] The first network may be a multi-task learning network, and the multi-task learning network may be, for example, an MMOE network or other networks, which are not limited here. Figure 3 Explain the MMOE network. It can be understood that the two tasks mean that two feature information of the target pet can be obtained. Figure 3 As shown, the MMOE network includes multiple expert networks, two gate networks and two task networks, that is, the number of gate networks and the number of task networks are the same as the number of tasks, and the number of expert networks can be set according to actual needs. Figure 3 In the figure, gate network 1 and task network 1 correspond to task 1, and gate network 2 and task network 2 correspond to task 2. Each expert network can process the input features through a fully connected network to extract features from the corresponding feature dimension. The number of layers of the fully connected network can be set according to actual needs. Each gated network can use a Softmax function to learn different combination modes of multiple expert networks for the corresponding task, that is, to adaptively weight the output results of multiple expert networks. Each task network can use a neural network to output the prediction results of the corresponding task.
[0047] For example, in Figure 3 In the example, after inputting the target feature map of at least one spliced image into the MMOE network, task 1 and task 2 can be output.
[0048] Among them, one characteristic information includes one of the following: age of the target pet, type of the target pet, weight of the target pet, physiological state of the target pet. The physiological state of the target pet may include at least one of the following: body temperature, heart rate, blood pressure, pulse, blood oxygen content, etc., which are not limited here.
[0049] 204. Generate a recipe for the target pet based on multiple feature information of the target pet.
[0050] Optionally, step 204 may include: determining first ingredient information of the target pet based on multiple characteristic information of the target pet; obtaining weight factors corresponding to the multiple characteristic information of the target pet, the weight factors representing the proportion of nutrients contained in the target pet's recipe; obtaining target ingredient information from the first ingredient information based on the weight factors; and generating a recipe for the target pet based on the target ingredient information.
[0051] Among them, the food information may include at least one of the following: identification information of at least one food, nutritional components of at least one food, weight of at least one food, etc., which are not limited here. The identification information of the food may be, for example, the name of the food, the number of the food, etc., which are not limited here. It can be understood that the identification information, nutritional components and weight of the same food are related. For example, the first food information may include: beef, nutritional components of beef, weight of beef, carrots, nutritional components of carrots, weight of carrots, pork chops, nutritional components of pork chops, weight of pork chops, etc.
[0052] Among them, in this application, the weight factor can be one or more, which is not limited here. It can be understood that there is one weight factor, that is, one weight factor corresponding to multiple feature information; there are multiple weight factors, that is, one feature information corresponds to one weight factor. The weight factors corresponding to different feature information can be different or the same, which is not limited here.
[0053] It can be seen that in the above technical solution, the first ingredient information of the target pet is determined based on multiple characteristic information of the target pet, so that the target ingredient information can be obtained from the first ingredient information according to the proportion of the nutrients contained in the target pet's recipe, so that the selected ingredients are more in line with the needs of the target pet, and thus a more targeted and accurate pet recipe can be generated.
[0054] Optionally, determining the first ingredient information of the target pet based on multiple characteristic information of the target pet may include: obtaining second ingredient information from an ingredient database based on the multiple characteristic information of the target pet; obtaining ingredient information of other pets, wherein the similarity between the multiple characteristic information of the other pets and the multiple characteristic information of the target pet is higher than a preset threshold; and determining the first ingredient information based on the second ingredient information and the ingredient information of the other pets.
[0055] In the present application, the food material database includes at least one corresponding relationship between characteristic information and food material information. Among them, obtaining the second food material information from the food material database according to multiple characteristic information of the target pet can be understood as: obtaining the second food material information according to multiple characteristic information of the target pet and the corresponding relationship. When obtaining the second food material information according to multiple characteristic information of the target pet and the corresponding relationship, for example, it can include: determining the characteristic information matching the multiple characteristic information of the target pet from the database; and determining the second food material information corresponding to the characteristic information matching the multiple characteristic information of the target pet according to the corresponding relationship.
[0056] The preset threshold value may be pre-configured in the electronic device.
[0057] Determining the first ingredient information according to the second ingredient information and the ingredient information of other pets includes: determining the union, subset or intersection of the union of the second ingredient information and the ingredient information of other pets as the first ingredient information.
[0058] It can be seen that in the above technical solution, the second ingredient information is obtained from the ingredient database based on multiple feature information of the target pet, and the first ingredient information is determined based on the second ingredient information and the ingredient information of other pets, thereby realizing the use of the ingredient information of other pets whose feature information similarity is higher than a preset threshold to enrich the ingredients of the target pet, avoiding the problem of the target pet's ingredients being too single.
[0059] Optionally, generating a recipe for a target pet based on target ingredient information includes: obtaining status information corresponding to the target pet; and generating a recipe for the target pet based on the status information and the target ingredient information.
[0060] The state information includes at least one of the following: environmental information, geographic location information, and time information. The environmental information may include at least one of the following: indoor environment and outdoor environment. The indoor environment may include, for example, at least one of the following: indoor temperature, indoor air humidity, indoor decibel information, etc. The outdoor environment may include, for example, at least one of the following: outdoor temperature, outdoor air humidity, outdoor decibel information, outdoor precipitation information, outdoor snowfall information, outdoor air pressure information, outdoor air quality, etc. The time information may include, for example, season information, etc.
[0061] It can be seen that in the above technical solution, by generating a recipe for the target pet based on the status information and the target ingredient information, the generated pet recipe is more refined and more in line with the needs of the pet.
[0062] Optionally, after generating a recipe for the target pet according to the status information and the target ingredient information, the solution may further include: obtaining multiple pet recipes from a recipe database; determining a pet recipe whose similarity to the recipe of the target pet is higher than a recipe similarity threshold from the multiple pet recipes; and pushing the pet recipe whose similarity to the recipe of the target pet is higher than the recipe similarity threshold to the user. That is, the pet recipe whose similarity to the recipe of the target pet is higher than the recipe similarity threshold is pushed to the user who keeps the pet, thereby enriching the pet recipes.
[0063] See also Figure 4 , Figure 4 FIG. 1 is a flow chart of another method for generating a pet recipe based on image recognition provided by an embodiment of the present application. The method for generating a pet recipe based on image recognition can be applied to electronic devices, such as Figure 4 As shown, the method includes:
[0064] 401. Display an image upload interface, where the image upload interface includes an image upload area and an image upload control.
[0065] Regarding step 401, please refer to Figure 2 The description of step 201 is omitted here.
[0066] 402. In response to an upload operation on an image upload control, obtain at least one image from an image upload area.
[0067] Regarding step 402, please refer to Figure 2 The description of step 201 is omitted here.
[0068] 403. Through the pre-built residual network, feature extraction is performed on each image, and the features extracted by convolutional layers of different depths are spliced to obtain the target feature map of each image.
[0069] For step 403, please refer to Figure 2 The description of step 202 is omitted here.
[0070] 404. Concatenate the target feature map of at least one image as input data of the first network, so as to perform multi-task classification through the first network to obtain multiple feature information of the target pet.
[0071] Regarding step 404, please refer to Figure 2 The description of step 203 is omitted here.
[0072] 405. Generate a recipe for the target pet based on multiple feature information of the target pet.
[0073] Regarding step 405, please refer to Figure 2The description of step 204 is omitted here.
[0074] It can be seen that in the above technical solution, by obtaining at least one image from the image upload area, the feature extraction of each image can be performed through the pre-built residual network, and the features extracted by the convolutional layers of different depths are spliced to obtain the target feature map of each image, which increases the richness and comprehensiveness of the extracted features, so that when the target feature map of at least one image is spliced as the input data of the first network, the multi-task classification through the first network can be performed to obtain multiple feature information of the target pet more accurately, that is, the result of multi-task classification is more accurate. At the same time, when generating a recipe for the target pet based on the multiple feature information of the target pet, the pertinence and accuracy of the pet recipe are improved.
[0075] See also Figure 5 , Figure 5 A schematic diagram of a pet recipe generation device based on image recognition provided in an embodiment of the present application. Figure 5 As shown, a pet recipe generation device 500 based on image recognition provided by an embodiment of the present application includes an acquisition module 501 and a processing module 502, wherein the acquisition module 501 is used to acquire at least one image containing different parts of a target pet, and each image includes at least one part of the target pet; the processing module 502 is used to extract features from each image through a pre-built residual network, and to splice the features extracted by convolutional layers of different depths to obtain a target feature map of each image; the processing module 502 is also used to splice the target feature map of at least one image as input data of the first network, so as to perform multi-task classification through the first network to obtain multiple feature information of the target pet; the processing module 502 is also used to generate a recipe for the target pet based on the multiple feature information of the target pet.
[0076] Among them, at least one image may include at least one of the following: a front view, a palm print view, left and right side views, a tail view, a back view, and a belly view of the target pet, without limitation.
[0077] A part of a target pet may include one of the following: eyes, nose, ears, mouth, teeth, back, tail, abdomen, paws, and toenails of the target pet, without limitation.
[0078] Among them, the residual network is a type of convolutional neural network, which is easy to optimize and can improve accuracy by increasing the depth. The residual blocks inside the residual network use skip connections, which alleviates the gradient vanishing problem caused by increasing the depth in the deep neural network.
[0079] Optionally, the convolutional layer in the residual network is used to extract multi-scale features in each image, wherein features of different scales reflect different feature maps. Specifically, the multi-scale features in each image include a shallower feature map and a deeper feature map of at least one part of the target pet, the shallower feature map includes at least one of the following: hair color information, hair diameter information, and hair length information of at least one part of the target pet, and the deeper feature map includes at least one of the following: hair sparseness information, dandruff residue information, and oil smudge information of at least one part of the target pet.
[0080] By extracting features from each image through a residual network, on the one hand, the computational cost can be reduced, and the gradient vanishing problem caused by increasing the depth of a deep neural network can be alleviated. On the other hand, multi-scale features in each image can be effectively obtained, which increases the richness and comprehensiveness of the extracted features, thereby making the results of multi-task classification more accurate.
[0081] Optionally, before extracting features from each image through a pre-built residual network and splicing the features extracted from convolutional layers of different depths to obtain a target feature map for each image, the processing module 502 is also used to pre-process each image to obtain each pre-processed image. It can be understood that when extracting features from each image through a pre-built residual network and splicing the features extracted from convolutional layers of different depths to obtain a target feature map for each image, the processing module 502 is specifically used to extract features from each pre-processed image through a pre-built residual network and splicing the features extracted from convolutional layers of different depths to obtain a target feature map for each image.
[0082] Optionally, when each image is preprocessed to obtain each preprocessed image, the processing module 502 is specifically used to perform image correction on each image, and perform contrast enhancement processing after correction to obtain each preprocessed image. The image correction includes image tilt correction and / or image brightness correction.
[0083] The first network may be a multi-task learning network, and the multi-task learning network may be, for example, an MMOE network or other networks, which is not limited here.
[0084] Among them, one characteristic information includes one of the following: age of the target pet, type of the target pet, weight of the target pet, physiological state of the target pet. The physiological state of the target pet may include at least one of the following: body temperature, heart rate, blood pressure, pulse, blood oxygen content, etc., which are not limited here.
[0085] It can be seen that in the above technical solution, by obtaining at least one image containing different parts of the target pet, the feature extraction of each image can be performed through the pre-built residual network, and the features extracted by the convolutional layers of different depths are spliced to obtain the target feature map of each image, which increases the richness and comprehensiveness of the extracted features, so that when the target feature map of at least one image is spliced as the input data of the first network, the multi-task classification through the first network can be performed to obtain multiple feature information of the target pet more accurately, that is, the result of the multi-task classification is more accurate. At the same time, when the recipe of the target pet is generated according to the multiple feature information of the target pet, the pertinence and accuracy of the pet recipe are improved.
[0086] Optionally, when acquiring at least one image containing different parts of the target pet, the acquisition module 501 is specifically used to:
[0087] Display the image upload interface, which includes the image upload area and the image upload control;
[0088] In response to an upload operation on the image upload control, at least one image is acquired from the image upload area.
[0089] The image upload interface may further include an image upload prompt area, which is used to display image upload prompt information, and the image upload prompt information is the preset requirements that the image uploaded by the user needs to meet. The preset requirements may include at least one of the following: size, resolution, etc., which are not limited here.
[0090] Optionally, when generating a recipe for the target pet according to multiple feature information of the target pet, the processing module 502 is specifically used to:
[0091] Determine first food information of the target pet according to multiple characteristic information of the target pet;
[0092] Obtaining weight factors corresponding to multiple feature information of the target pet, where the weight factors are the proportions of nutrients contained in the target pet's diet;
[0093] Acquire target ingredient information from the first ingredient information according to the weight factor;
[0094] Generate a recipe for the target pet based on the target ingredient information.
[0095] Among them, the food information may include at least one of the following: identification information of at least one food, nutritional components of at least one food, weight of at least one food, etc., which are not limited here. The identification information of the food may be, for example, the name of the food, the number of the food, etc., which are not limited here. It can be understood that the identification information, nutritional components and weight of the same food are related. For example, the first food information may include: beef, nutritional components of beef, weight of beef, carrots, nutritional components of carrots, weight of carrots, pork chops, nutritional components of pork chops, weight of pork chops, etc.
[0096] Among them, in this application, the weight factor can be one or more, which is not limited here. It can be understood that there is one weight factor, that is, one weight factor corresponding to multiple feature information; there are multiple weight factors, that is, one feature information corresponds to one weight factor. The weight factors corresponding to different feature information can be different or the same, which is not limited here.
[0097] It can be seen that in the above technical solution, the first ingredient information of the target pet is determined based on multiple characteristic information of the target pet, so that the target ingredient information can be obtained from the first ingredient information according to the proportion of the nutrients contained in the target pet's recipe, so that the selected ingredients are more in line with the needs of the target pet, and thus a more targeted and accurate pet recipe can be generated.
[0098] Optionally, when determining the first food information of the target pet according to the multiple characteristic information of the target pet, the processing module 502 is specifically used to:
[0099] According to the plurality of characteristic information of the target pet, obtaining second food material information from the food material database;
[0100] Acquire food information of other pets, where the similarity between multiple feature information of other pets and multiple feature information of the target pet is higher than a preset threshold;
[0101] The first ingredient information is determined according to the second ingredient information and the ingredient information of other pets.
[0102] In the present application, the food material database includes at least one corresponding relationship between characteristic information and food material information. Among them, obtaining the second food material information from the food material database according to multiple characteristic information of the target pet can be understood as: obtaining the second food material information according to multiple characteristic information of the target pet and the corresponding relationship. When obtaining the second food material information according to multiple characteristic information of the target pet and the corresponding relationship, for example, it can include: determining the characteristic information matching the multiple characteristic information of the target pet from the database; and determining the second food material information corresponding to the characteristic information matching the multiple characteristic information of the target pet according to the corresponding relationship.
[0103] The preset threshold value may be pre-configured in the electronic device.
[0104] When determining the first ingredient information according to the second ingredient information and the ingredient information of other pets, the processing module 502 is specifically configured to determine the union, subset or intersection of the union of the second ingredient information and the ingredient information of other pets as the first ingredient information.
[0105] It can be seen that in the above technical solution, the second ingredient information is obtained from the ingredient database based on multiple feature information of the target pet, and the first ingredient information is determined based on the second ingredient information and the ingredient information of other pets, thereby realizing the use of the ingredient information of other pets whose feature information similarity is higher than a preset threshold to enrich the ingredients of the target pet, avoiding the problem of the target pet's ingredients being too single.
[0106] Optionally, when generating a recipe for the target pet according to the target food information, the processing module 502 is specifically configured to:
[0107] Obtaining status information corresponding to the target pet;
[0108] A recipe for the target pet is generated according to the status information and the target ingredient information.
[0109] The state information includes at least one of the following: environmental information, geographic location information, and time information. The environmental information may include at least one of the following: indoor environment and outdoor environment. The indoor environment may include, for example, at least one of the following: indoor temperature, indoor air humidity, indoor decibel information, etc. The outdoor environment may include, for example, at least one of the following: outdoor temperature, outdoor air humidity, outdoor decibel information, outdoor precipitation information, outdoor snowfall information, outdoor air pressure information, outdoor air quality, etc. The time information may include, for example, season information, etc.
[0110] It can be seen that in the above technical solution, by generating a recipe for the target pet based on the status information and the target ingredient information, the generated pet recipe is more refined and more in line with the needs of the pet.
[0111] Optionally, after generating the recipe of the target pet according to the state information and the target ingredient information, the acquisition module 501 is further used to acquire multiple pet recipes from the recipe database; the processing module 502 is further used to determine the pet recipes whose similarity with the recipe of the target pet is higher than the recipe similarity threshold from the multiple pet recipes; the processing module 502 is further used to push the pet recipes whose similarity with the recipe of the target pet is higher than the recipe similarity threshold to the user. That is, the pet recipes whose similarity with the recipe of the target pet is higher than the recipe similarity threshold are pushed to the users who keep pets, thereby enriching the pet recipes.
[0112] See also Figure 6 , Figure 6 A schematic diagram of the electronic device structure of the hardware operating environment involved in the embodiments of the present application.
[0113] The embodiment of the present application provides an electronic device for generating pet recipes based on image recognition, comprising a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the processor to execute instructions including any step in the method for generating pet recipes based on image recognition. Figure 6 As shown, the electronic device of the hardware operating environment involved in the embodiment of the present application may include:
[0114] The processor 601 is, for example, a CPU.
[0115] Memory 602, optionally, the memory may be a high-speed RAM memory, or a stable memory, such as a disk memory.
[0116] The communication interface 603 is used to realize the connection and communication between the processor 601 and the memory 602 .
[0117] Those skilled in the art will understand that Figure 6 The structure of the electronic device shown in the figure does not constitute a limitation thereto, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0118] like Figure 6 As shown, the memory 602 may include an operating system, a network communication module, and one or more programs. The operating system is a program that manages and controls server hardware and software resources and supports the operation of one or more programs. The network communication module is used to realize communication between components inside the memory 602, and communication with other hardware and software inside the electronic device.
[0119] exist Figure 6 In the electronic device shown, the processor 601 is used to execute one or more programs in the memory 602 to implement the following steps:
[0120] Acquire at least one image containing different parts of the target pet, each image including at least one part of the target pet;
[0121] Through the pre-built residual network, feature extraction is performed on each image, and the features extracted by convolutional layers of different depths are spliced to obtain the target feature map of each image;
[0122] splicing the target feature map of at least one image as input data of the first network, so as to perform multi-task classification through the first network to obtain multiple feature information of the target pet;
[0123] Generate a recipe for the target pet based on multiple feature information of the target pet.
[0124] The specific implementation of the electronic device involved in the present application can be found in the various embodiments of the above-mentioned pet recipe generation method based on image recognition, which will not be elaborated here.
[0125] The present application also provides a computer-readable storage medium, the computer-readable storage medium is used to store a computer program, and the stored computer program is executed by a processor to implement the following steps:
[0126] Acquire at least one image containing different parts of the target pet, each image including at least one part of the target pet;
[0127] Through the pre-built residual network, feature extraction is performed on each image, and the features extracted by convolutional layers of different depths are spliced to obtain the target feature map of each image;
[0128] splicing the target feature map of at least one image as input data of the first network, so as to perform multi-task classification through the first network to obtain multiple feature information of the target pet;
[0129] Generate a recipe for the target pet based on multiple feature information of the target pet.
[0130] The specific implementation of the computer-readable storage medium involved in the present application can be found in the various embodiments of the above-mentioned pet recipe generation method based on image recognition, which will not be elaborated here.
[0131] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
[0132] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A pet recipe generation method based on image recognition, It is characterized in that include: Acquire at least one image containing different parts of a target pet, each image including at least one part of the target pet; Through the pre-built residual network, feature extraction is performed on each image, and the features extracted by convolutional layers of different depths are spliced to obtain a target feature map of each image; splicing the target feature map of the at least one image as input data of the first network, so as to perform multi-task classification through the first network to obtain multiple feature information of the target pet; Generate a recipe for the target pet according to multiple feature information of the target pet; The convolutional layer in the residual network is used to extract multi-scale features in each image, wherein features of different scales reflect different feature maps, and the multi-scale features in each image include a shallower feature map and a deeper feature map of at least one part of the target pet, the shallower feature map includes at least one of the following: hair color information, hair diameter information, and hair length information of at least one part of the target pet, and the deeper feature map includes at least one of the following: hair sparseness information, dandruff residue information, and oil smudge information of at least one part of the target pet; The method of generating a recipe for the target pet based on the multiple characteristic information of the target pet includes: determining first food information of the target pet based on the multiple characteristic information of the target pet; obtaining weight factors corresponding to the multiple characteristic information of the target pet, wherein the weight factors are the proportions of nutrients contained in the recipe of the target pet; obtaining target food information from the first food information based on the weight factors; and generating a recipe for the target pet based on the target food information. The method of generating a recipe for the target pet based on the target ingredient information includes: obtaining status information corresponding to the target pet; generating a recipe for the target pet based on the status information and the target ingredient information; the status information includes at least one of the following: environmental information, geographic location information, and time information.
2. The method according to claim 1, It is characterized in that The step of obtaining at least one image containing different parts of the target pet includes: Display an image upload interface, wherein the image upload interface includes an image upload area and an image upload control; In response to an upload operation on the image upload control, the at least one image is acquired from the image upload area.
3. The method according to claim 1, It is characterized in that The determining the first food information of the target pet according to the plurality of feature information of the target pet includes: Acquire second food material information from a food material database according to the plurality of characteristic information of the target pet; Acquire food information of other pets, where the similarity between the multiple feature information of the other pets and the multiple feature information of the target pet is higher than a preset threshold; The first food information is determined according to the second food information and the food information of the other pets.
4. The method according to any one of claims 1 to 3, It is characterized in that One piece of characteristic information includes one of the following: the age of the target pet, the type of the target pet, the weight of the target pet, and the physiological state of the target pet.
5. A pet recipe generation device based on image recognition, It is characterized in that The device comprises an acquisition module and a processing module. The acquisition module is used to acquire at least one image containing different parts of the target pet, each image including at least one part of the target pet; The processing module is used to extract features from each image through a pre-built residual network, and to splice features extracted from convolutional layers of different depths to obtain a target feature map for each image; The processing module is further used to splice the target feature map of the at least one image as input data of the first network, so as to perform multi-task classification through the first network to obtain multiple feature information of the target pet; The processing module is further used to generate a recipe for the target pet based on multiple feature information of the target pet; The convolutional layer in the residual network is used to extract multi-scale features in each image, wherein features of different scales reflect different feature maps, and the multi-scale features in each image include a shallower feature map and a deeper feature map of at least one part of the target pet, the shallower feature map includes at least one of the following: hair color information, hair diameter information, and hair length information of at least one part of the target pet, and the deeper feature map includes at least one of the following: hair sparseness information, dandruff residue information, and oil smudge information of at least one part of the target pet; When generating a recipe for the target pet according to multiple feature information of the target pet, the processing module is used to: determine first food information of the target pet according to the multiple feature information of the target pet; obtain weight factors corresponding to the multiple feature information of the target pet, wherein the weight factors are the proportions of the nutrients contained in the recipe of the target pet; obtain target food information from the first food information according to the weight factors; and generate a recipe for the target pet according to the target food information; When generating a recipe for the target pet based on the target ingredient information, the processing module is used to: obtain status information corresponding to the target pet; generate a recipe for the target pet based on the status information and the target ingredient information; the status information includes at least one of the following: environmental information, geographic location information, and time information.
6. An electronic device for generating pet recipes based on image recognition, It is characterized in that The method comprises a processor, a memory, a communication interface and one or more programs, wherein the one or more programs are stored in the memory and are generated to be executed by the processor to perform instructions of the steps in the method according to any one of claims 1 to 4.
7. A computer-readable storage medium, It is characterized in that The computer-readable storage medium is used to store a computer program, and the stored computer program is executed by the processor to implement the method according to any one of claims 1 to 4.
