Neural network training method and device, and associated object detection method and device
Generating candidate object groups and adjusting parameters through the neural network training method solves the problem of difficult object correlation analysis in multi-object scenes, and achieves more accurate object matching calculation and correlation detection.
Patent Information
- Application Number
- CN202180001316.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-12-31
- Filing Date
- 2021-04-28
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2041-04-28
AI Technical Summary
In intelligent scene detection, it is difficult to analyze the correlation between objects in a multi-object scene, especially when there is occlusion or overlap. It is difficult for the existing technology to accurately detect the correlation between objects, which may lead to missed detection or Error detection.
The neural network training method is used to generate candidate object groups by detecting objects in the image, and the matching degree between objects is determined based on the neural network, and the group association loss is used to adjust the network parameters to improve the matching degree calculation accuracy between objects. .
It achieves more accurate detection of the correlation between objects in the image, reduces the occurrence of incorrect matching pairs, improves the ability to identify correct matching pairs, and improves the accuracy of detection results.
Smart Images

Figure CN113544700B_ABST
Abstract
Description
[0001] Cross-references
[0002] This application claims priority to Singapore Patent Application No. 10202013245S filed on December 31, 2020, the entire contents of which are incorporated herein by reference for all purposes. Technical Field
[0003] The present disclosure relates to the field of computer vision technology, and in particular to a method and device for training a neural network, and a method and device for detecting associated objects. Background Art
[0004] In intelligent scene detection, object detection and recognition is an important research direction. Multi-dimensional object analysis can obtain rich object information, which helps to study the state and change trend of the object. In a specific scenario of object detection and recognition, the association relationship between objects in the image can be analyzed, and the potential relationship between objects can be automatically extracted to obtain more association information in addition to the attributes of the object itself.
[0005] For scenes with multiple objects, especially scenes where there is occlusion or overlap between multiple objects in the image, it is difficult to analyze the association between objects. It is difficult to obtain accurate detection results by determining the associated objects based solely on prior knowledge of the positional relationship between objects. For example, there may be missed detections or false detections. For example, in the scene of intelligent detection of multiplayer games, different body parts such as hands and faces in the video need to be associated with the corresponding human bodies to identify the actions of different people. However, there may be occlusion or overlap between multiple human bodies, which increases the difficulty of detecting the association between human body parts and human bodies. Summary of the invention
[0006] The present disclosure provides a neural network training method and device, and an associated object detection method and device.
[0007] According to a first aspect of an embodiment of the present disclosure, a neural network training method is provided, the method comprising: detecting first-category objects and second-category objects in an image; generating at least one candidate object group based on the detected first-category objects and second-category objects, wherein the candidate object group comprises at least one first-category object and at least two second-category objects; determining, based on a neural network, a degree of matching between the first-category objects and respective second-category objects in the same candidate object group; determining a group association loss of the candidate object group based on a degree of matching between the first-category objects and respective second-category objects in the same candidate object group, wherein the group association loss is positively correlated with a degree of matching between the first-category objects and non-associated second-category objects; and adjusting network parameters of the neural network based on the group association loss.
[0008] In some optional embodiments, the group association loss is also negatively correlated to the matching degree between the first category objects and the associated second category objects within the candidate object group.
[0009] In some optional embodiments, the method further includes: determining that the neural network has completed training when the group association loss is less than a preset loss value.
[0010] In some optional embodiments, the detecting of first-category objects and second-category objects in an image comprises: extracting a feature map of the image; determining first-category objects and second-category objects in the image based on the feature map; the determining of the degree of match between the first-category objects and respective second-category objects in the same candidate object group based on a neural network comprises: determining a first feature of the first-category objects based on the feature map; determining a second feature of respective second-category objects in the candidate object group based on the feature map to obtain a second feature set corresponding to the first feature; splicing respective second features in the second feature set with the first feature to obtain a spliced feature set; and determining, based on the neural network, the degree of match between the second-category objects corresponding to the spliced features in the spliced feature set and the first-category objects.
[0011] In some optional embodiments, each second-category object in the candidate object group satisfies a preset relative position relationship with the first-category object; or, a detection frame of each second-category object in the candidate object group has an overlapping area with a detection frame of the first-category object.
[0012] In some optional embodiments, the first category of objects includes first human body part objects, and the second category of objects includes human body objects; or, the first category of objects includes human body objects, and the second category of objects includes first human body part objects.
[0013] In some optional embodiments, the first human body part object includes a human face object or a human hand object.
[0014] In some optional embodiments, the method also includes: detecting a third category of objects in the image; generating at least one candidate object group based on the detected first category of objects and second category of objects, including: generating at least one candidate object group based on the detected first category of objects, second category of objects and third category of objects, each candidate object group also includes at least two of the third category of objects; the method also includes: determining the degree of match between the first category of objects and each third category of objects in the same candidate object group based on a neural network; and the group association loss is also positively correlated with the degree of match between the first category of objects and non-associated third category objects.
[0015] In some optional embodiments, the third category of objects includes second human body part objects.
[0016] According to a second aspect of an embodiment of the present disclosure, a method for detecting associated objects is provided, including: detecting first-category objects and second-category objects in an image; generating at least one object group based on the detected first-category objects and second-category objects, the object group including one first-category object and at least two second-category objects; determining a degree of match between the first-category objects and respective second-category objects in the same object group; and determining a second-category object associated with the first-category object based on a degree of match between the first-category objects and respective second-category objects in the same object group.
[0017] In some optional embodiments, generating at least one object group based on the detected first-category objects and second-category objects includes: performing a combination operation on the detected first-category objects; the combination operation includes: combining the first-category objects with any at least two detected second-category objects into one object group; or, combining the first-category objects with each detected second-category objects into one object group.
[0018] In some optional embodiments, generating at least one object group based on the detected first-category objects and second-category objects includes: determining, based on the position information of the detected first-category objects and second-category objects, at least two second-category objects that satisfy a preset relative position relationship with the first-category objects as candidate associated objects of the first-category objects; and combining the first-category objects and each candidate associated objects of the first-category objects into an object group.
[0019] In some optional embodiments, the first category of objects includes first human body part objects, and the second category of objects includes human body objects; or, the first category of objects includes human body objects, and the second category of objects includes first human body part objects.
[0020] In some optional embodiments, the first human body part object includes a human face object or a human hand object.
[0021] In some optional embodiments, the method also includes: detecting a third category of objects in an image; generating at least one object group based on the detected first category of objects and second category of objects, including: generating at least one object group based on the detected first category of objects, second category of objects and third category of objects, the object group also includes at least two third category objects; the method also includes: determining a degree of match between the first category of objects and each third category of objects in the same object group; determining a third category of objects associated with the first category of objects based on a degree of match between the first category of objects and each third category of objects in the same object group.
[0022] In some optional embodiments, the third category of objects includes second human body part objects.
[0023] In some optional embodiments, determining the degree of matching between the first category of objects and each second category of objects in the same object group includes: determining the degree of matching between the first category of objects and each second category of objects in the same object group based on a pre-trained neural network; wherein the neural network is trained according to any one of the methods provided in the first aspect.
[0024] According to a third aspect of an embodiment of the present disclosure, a neural network training device is provided, the device comprising: an object detection module, for detecting first-category objects and second-category objects in an image; a candidate object group generation module, for generating at least one candidate object group based on the detected first-category objects and second-category objects, wherein the candidate object group comprises at least one first-category object and at least two second-category objects; a matching degree determination module, for determining the matching degrees between the first-category objects and each second-category object in the same candidate object group based on the neural network; a group association loss determination module, for determining the group association loss of the candidate object group based on the matching degrees between the first-category objects and each second-category object in the same candidate object group, wherein the group association loss is positively correlated with the matching degrees between the first-category objects and non-associated second-category objects; and a network parameter adjustment module, for adjusting the network parameters of the neural network based on the group association loss.
[0025] According to a fourth aspect of an embodiment of the present disclosure, there is provided a device for detecting associated objects, comprising: a detection module, for detecting first-category objects and second-category objects in an image; an object group generation module, for generating at least one object group based on the detected first-category objects and second-category objects, the object group comprising one first-category object and at least two second-category objects; a determination module, for determining a degree of matching between the first-category objects and respective second-category objects in the same object group; and an associated object determination module, for determining a second-category object associated with the first-category object based on a degree of matching between the first-category objects and respective second-category objects in the same object group.
[0026] According to a fifth aspect of an embodiment of the present disclosure, there is provided a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for training a neural network described in any one of the first aspects is implemented, or the method for detecting an associated object described in any one of the second aspects is implemented.
[0027] According to a sixth aspect of an embodiment of the present disclosure, there is provided a computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the program implements the training method of a neural network described in any one of the first aspects, or implements the detection method of an associated object described in any one of the second aspects.
[0028] According to a seventh aspect of an embodiment of the present disclosure, there is provided a computer program product, comprising a computer program, wherein when the program is executed by a processor, the program implements any of the neural network training methods described in the first aspect, or implements any of the associated object detection methods described in the second aspect.
[0029] In the disclosed embodiment, on the basis of detecting the first class object and the second class object in the image, a candidate object group is generated based on at least one first class object and at least two second class objects, and the matching degree of the first class object and the second class object is determined based on the neural network, and the group association loss corresponding to the candidate object group is obtained according to the determined multiple matching degrees, and the network parameters of the neural network are adjusted according to the group association loss to complete the training of the neural network. In this training method, the loss function (group association loss) is obtained according to the matching degree of multiple matching pairs composed of the first class object and the second class object in the candidate object group, and then the network parameters of the neural network are adjusted according to the group association loss obtained according to the loss function corresponding to the candidate object group. This training method can use multiple matching pairs to achieve global optimization of the neural network. By minimizing the loss function, the matching degree of the wrong matching pair is suppressed, and the distance between the objects in the wrong matching pair is pushed away; the matching degree of the correct matching pair is encouraged, and the distance between the objects in the correct matching pair is shortened. As a result, the neural network trained in this way can more accurately detect and determine the correct matching pairs between the first class object and the second class object in the image, and more accurately determine the association relationship between the first class object and the second class object.
[0030] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0032] Figure 1 is a flow chart of a neural network training method according to an exemplary embodiment;
[0033] Figure 2 is a schematic diagram of a detected image according to an exemplary embodiment;
[0034] Figure 3 is a schematic diagram of a neural network framework according to an exemplary embodiment;
[0035] Figure 4 is a flow chart of a matching degree determination method according to an exemplary embodiment;
[0036] Figure 5 A method for detecting an associated object is shown according to an exemplary embodiment;
[0037] Figure 6 A neural network training device is shown according to an exemplary embodiment;
[0038] Figure 7 Another neural network training device is shown according to an exemplary embodiment;
[0039] Figure 8 A detection device for an associated object is shown according to an exemplary embodiment;
[0040] Fig. 9 The diagram is a schematic structural diagram of a computer device according to an exemplary embodiment. DETAILED DESCRIPTION
[0041] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The specific methods described in the following exemplary embodiments do not represent all schemes consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0042] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. The singular forms of "a", "said" and "the" used in this disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0043] It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0044] The association between human body parts and human bodies is an important part of intelligent video analysis. For example, in the scenario of intelligent monitoring of multiplayer chess and card games, the system needs to associate different hands in the video with the corresponding human bodies to determine the actions made by different human bodies and realize intelligent monitoring of different human bodies during multiplayer chess and card games.
[0045] The present disclosure provides a training method for a neural network, which can better adjust the network parameters of the neural network so that the trained neural network can more accurately detect the matching degree between human body parts and human bodies, thereby determining the association relationship between human body parts and human bodies in an image. In the process of training the neural network, a candidate object group can be generated based on the first class of objects and the second class of objects detected in the image, and the matching degree between the first class of objects and each second class of objects in the same candidate object group can be determined based on the neural network, and the group association loss of the corresponding candidate object group is obtained using the determined multiple matching degrees, so as to adjust the network parameters of the neural network according to the group association loss.
[0046] In order to make the training method of the neural network provided by the present disclosure clearer, the execution process of the scheme provided by the present disclosure is described in detail below with reference to the accompanying drawings and specific embodiments.
[0047] See also Figure 1 , Figure 1 FIG. 1 is a flow chart of a neural network training method shown in an embodiment of the present disclosure. Figure 1 As shown, the process includes:
[0048] Step 101: Detect first-category objects and second-category objects in an image.
[0049] The detected image may be an image containing multiple types of objects, wherein the types of objects are predefined, for example, two types of objects, such as people and objects, or types divided according to attributes such as gender and age of people, or types divided according to characteristics such as color and function of objects.
[0050] In some embodiments, the objects in the image include human body part objects and human body objects. That is, the first type of objects and the second type of objects can be human body part objects or human body objects. Among them, human body part objects are local parts of the human body, such as human hands, human faces, human feet, etc. Exemplarily, when using an intelligent monitoring device to monitor the process of a multiplayer chess and card game, the image collected by the intelligent monitoring device can be used as the image detected in this step.
[0051] like Figure 2 As shown, it is an image of a multiplayer game scene captured by the intelligent monitoring device, which can be used as the detected image in the embodiment of the present disclosure. The captured image contains multiple human objects participating in the game: human body B1, human body B2 and human body B3, and corresponding human hand objects (human body part objects): human hands H1 and H2 corresponding to human body B1; human hand H3 corresponding to human body B2; human hands H4 and H5 corresponding to human body B3. Figure 2In the figure, the human object is indicated by a human detection box, and the hand object is indicated by a hand detection box.
[0052] In an embodiment of the present disclosure, a first category of objects in an image is distinguished from a second category of objects, and there is a certain association relationship between the first category of objects and the second category of objects. Wherein, in the case where the first category of objects includes human body part objects, the second category of objects may include human body part objects of a different type from the human body part objects included in the first category of objects, or the second category of objects may include human body objects. Alternatively, in the case where the second category of objects includes human body part objects, the first category of objects may include human body part objects of a different type from the human body part objects included in the second category of objects, or the first category of objects includes human body objects. Wherein, the type of human body part objects corresponds to the body part they refer to, for example, a face object, a hand object, and an elbow object correspond to a face, a hand, and an elbow, respectively, and their types are different from each other.
[0053] In some optional embodiments, the first category of objects includes first human body part objects, and the second category of objects includes human body objects; or, the first category of objects includes human body objects, and the second category of objects includes first human body part objects. The first human body part objects include human face objects or human hand objects.
[0054] Exemplarily, taking a human hand as the first type of object and a human body as the second type of object, this step can detect the human hand and human body in the image. Figure 2 As shown, this step can be Figure 2 The first category of objects are detected: human hands H1, human hands H2, human hands H3, human hands H4 and human hands H5; the second category of objects are detected: human bodies B1, human bodies B2 and human bodies B3.
[0055] It is understandable that the images detected in this step can be obtained in a variety of different ways to achieve the training of the neural network, and the embodiments of the present disclosure are not limited. For example, images in different scenes can be collected by intelligent monitoring equipment. For example, images of multi-person chess and card games can be collected by intelligent monitoring equipment. For example, images containing human body part objects and human body objects can be screened out through different image databases.
[0056] It should be noted that the way of detecting the first category of objects and the second category of objects in the image in this step may include various forms, which are not limited in this embodiment. Exemplarily, the first category of objects in the image may be detected first, and then the second category of objects in the image may be detected, and finally the first category of objects and the second category of objects in the image may be detected. Alternatively, the first category of objects and the second category of objects in the image may be detected simultaneously through one detection.
[0057] In some possible implementations, a detection network that can simultaneously detect the first category of objects and the second category of objects in an image can be pre-trained, and the trained detection network can be used to detect the first category of objects and the second category of objects from the image at one time. For example, a face and human body joint detection neural network can be pre-trained, and in this embodiment, the trained face and human body joint detection neural network can be used to simultaneously detect face objects and human body objects from an image.
[0058] Step 102: Generate at least one candidate object group based on the detected first-category objects and second-category objects, wherein the candidate object group includes at least one first-category object and at least two second-category objects.
[0059] In the case where the first category object and the second category object are detected in the image, this step may generate a candidate object group based on the detected first category object and at least two second category objects; or, this step may generate a candidate object group based on at least two first category objects and at least two second category objects. Since the first category object detected in the image may include multiple objects, the candidate object group generated based on the first category object may also include multiple objects.
[0060] Still Figure 2 The first type of objects detected are: human hands H1, human hands H2, human hands H3, human hands H4 and human hands H5; the second type of objects are: human bodies B1, human bodies B2 and human bodies B, for example. This step can be based on Figure 2 The first and second types of objects detected in the image are used to generate corresponding candidate object groups. Exemplarily, the human hand H1, the human body B1, the human body B2 and the human body B3 can be combined to obtain a candidate object group; or the human hand H1, the human hand H2, the human body B1, the human body B2 and the human body B3 can be combined to obtain another candidate object group. It can be understood that more different candidate object groups can be generated based on different combinations, which are not exhaustive here.
[0061] In some optional embodiments, each second-category object in the candidate object group satisfies a preset relative position relationship with the first-category object; or, a detection frame of each second-category object in the candidate object group has an overlapping area with a detection frame of the first-category object.
[0062] In the above embodiment, a relative position relationship can be preset. For any detected first-category object, a second-category object that satisfies a preset relative position relationship with the first-category object is added to the candidate object group where the first-category object is located. In this way, it can be ensured that the first-category object and the second-category object in the same candidate object group satisfy the preset relative position relationship. Among them, the preset relative position relationship may include any at least one of the following: the position distance between the first-category object and the second-category object is less than a preset threshold, and there is an overlapping area in the detection frame. Then the distance between the first-category object and the second-category object in the same candidate object group is less than the preset threshold, and / or there is an overlapping area in the detection frame of the first-category object and the detection frame of the second-category object in the same candidate object group.
[0063] In this optional embodiment, the relative position relationship can be pre-set so that the first-category object and the second-category object in the same candidate object group are objects that may have a certain association, so that the second-category object that is correctly associated with the first-category object can be further determined from the candidate object group. This method can preliminarily generate objects that may have an association relationship from the first-category object and the second-category object detected in the image in the same candidate object group, so that the second-category object that is correctly associated with the first-category object can be further specifically determined from the candidate object group, thereby improving the accuracy of the calculation result of the matching degree between the first-category object and the second-category object.
[0064] by Figure 2 For example, the relative position relationship can be preset as follows: the detection frames overlap; then in the same candidate object group, the detection frame of the first type of object human hand H5 has overlapping areas with the detection frames of the second type of objects human body B2 and human body B3 respectively.
[0065] Step 103: determining the matching degree between the first category objects and each second category object in the same candidate object group based on the neural network.
[0066] In this step, a neural network for detecting the degree of match between the first category of objects and the second category of objects can be pre-set. For example, a neural network known to be used for detecting associations between objects can be pre-trained using training samples to obtain a neural network that can be used in this step. This step can be based on a pre-set neural network to detect and determine the degree of match between the first category of objects and each second category of objects in the same candidate object group. The degree of match is used to characterize the degree of association between the detected first category of objects and the second category of objects. The specific representation of the degree of match can include multiple forms, which are not limited by the embodiments of the present disclosure. Exemplary, it can be expressed in numerical form, percentage form, grade form, etc.
[0067] by Figure 2For example, the candidate object group G1 includes: first class object: human hand H5; second class object: human body B2 and human body B3. This step can determine the matching degree M1 between human hand H5 and human body B2; and the matching degree M2 between human hand H5 and human body B3 in the candidate object group G1 based on a preset neural network.
[0068] Step 104: determine the group association loss of the candidate object group according to the matching degree between the first category objects and each second category object in the same candidate object group, wherein the group association loss is positively correlated with the matching degree between the first category objects and unrelated second category objects.
[0069] In this embodiment, the association relationship between the first category object and the second category object may be pre-annotated. The first category object and the second category object are associated, indicating that there is a specific similarity relationship, the same belonging relationship, etc. between the two. Manual annotation can be performed on the association relationship between the first category object and the second category object in the detected image to obtain annotation information. In this way, the second category object associated with the first category object and the second category object not associated with the first category object in the same candidate group can be distinguished.
[0070] Combined with the above Figure 2 , two corresponding matching degrees are obtained from the candidate object group G1: matching degree M1 and matching degree M2. This step can determine the group association loss Group loss1 corresponding to the candidate object group G1 according to the two matching degrees obtained. Moreover, the first type of object human hand H5 is not associated with the second type of object human body B2, and accordingly, the group association loss Grouploss 1 is positively correlated with the matching degree M1.
[0071] Since the group association loss is positively correlated with the matching degree between the first-category objects and the unrelated second-category objects, the matching degree between the first-category objects and the unrelated second-category objects can be suppressed by minimizing the group association loss, and the distance between the first-category objects and the unrelated second-category objects can be pushed away, so that the neural network can have a better ability to distinguish between the first-category objects and the unrelated second-category objects after training.
[0072] In some optional embodiments, the group association loss is also negatively correlated to the matching degree between the first class object and the associated second class object in the candidate object group. For example, since the first class object human hand H5 is associated with the second class object human body B3, the group association loss 1 is negatively correlated to the matching degree M2.
[0073] Since the group association loss is negatively correlated with the matching degree between the first-category objects and the associated second-category objects, the matching degree between the first-category objects and the associated second-category objects can be encouraged by minimizing the group association loss, thereby shortening the distance between the first-category objects and the associated second-category objects, so that the neural network can have a better ability to distinguish between the first-category objects and the associated second-category objects after training, thereby achieving global optimization of the neural network and improving the accuracy of its matching degree calculation results between the first-category objects and the second-category objects.
[0074] The following is a specific example to illustrate how to set the loss function (obtain the group association loss) so that the group association loss is positively correlated with the matching degree between the first category object and the unassociated second category object, and negatively correlated with the matching degree between the first category object and the associated second category object.
[0075] Combination Figure 2 The image shown in FIG. 1 is an exemplary illustration of the preset loss function. The candidate object group G2 includes the first type of object: the human hand H3, and the second type of objects: the human body B1, the human body B2, and the human body B3. The human hand H3 is associated with the human body B2 (i.e., the human hand H3 and the human body B2 belong to the same person). For example, the matching degree between the human hand H3 and the human body B2 is denoted as S P ; The matching degree between the hand H3 and the body B1 is denoted as S n1 ; The matching degree between the hand H3 and the body B3 is denoted as S n2 ; Group association loss is recorded as L Group . Exemplarily, the loss function may be preset as follows:
[0076] L Group =-log(exp(s p ) / (exp s p +exp s n1 +exp s n2 ))
[0077] The group association loss of the candidate object group is calculated according to the above loss function. The loss function is negatively correlated with the matching degree of the associated first-class objects and the second-class objects in the group, and positively correlated with the matching degree of the unassociated first-class objects and the second-class objects in the group. In addition, it can also make the neural network converge quickly.
[0078] Step 105: adjusting the network parameters of the neural network according to the group association loss.
[0079] In some optional embodiments, a large number of sample images can be used as images detected by this embodiment to train the neural network until the preset training requirements are met. In one possible implementation, when the group association loss is less than a preset loss value, it is determined that the neural network has completed training. This implementation method, by minimizing the loss function, suppresses the matching degree between the first category of objects and the unassociated second category of objects, and pushes the distance between the first category of objects and the unassociated second category of objects away; it encourages the matching degree between the first category of objects and the associated second category of objects, and shortens the distance between the first category of objects and the associated second category of objects. In another possible implementation, when the number of training times of the neural network reaches a preset number threshold, it is determined that the neural network has completed training.
[0080] In the embodiment of the present disclosure, based on the detection of first-category objects and second-category objects in the image, a candidate object group is generated based on at least one first-category object and at least two second-category objects, and the matching degrees of the first-category objects with the second-category objects are respectively determined based on a neural network, and the group association loss corresponding to the candidate object group is obtained based on the determined multiple matching degrees, and the network parameters of the neural network are adjusted based on the group association loss to complete the training of the neural network.
[0081] In this training method, the loss function (group association loss) is obtained according to the matching degree of multiple matching pairs consisting of the first category object and the second category object in the candidate object group, and then the network parameters of the neural network are adjusted according to the group association loss obtained according to the loss function corresponding to the candidate object group. Compared with obtaining the value of the loss function based only on the matching degree of a matching pair consisting of the first category object and the second category object, this training method can use multiple matching pairs to achieve global optimization of the neural network. By minimizing the loss function, the matching degree of the wrong matching pair is suppressed, and the distance between the objects in the wrong matching pair is pushed away; the matching degree of the correct matching pair is encouraged, and the distance between the objects in the correct matching pair is shortened. As a result, the neural network trained in this way can more accurately detect and determine the correct matching pairs between the first category object and the second category object in the image, and more accurately determine the association relationship between the first category object and the second category object.
[0082] For multi-object scenes, especially scenes where there are occlusions or overlaps between multiple objects in the image, it is difficult to analyze the association relationship between objects in the image. In the related art, the association relationship is determined only based on prior knowledge of the positional relationship between objects, which may result in missed detection or false detection, making it difficult to obtain accurate detection results. The neural network obtained by the training method provided in this embodiment can treat multiple first-class objects and second-class objects in the image that may have an association relationship as detection objects in the same group in the form of candidate object groups, and realize global optimization of the association relationship detection of multiple matching pairs consisting of first-class objects and second-class objects in the image on the basis of candidate object groups, thereby improving the accuracy of the calculation results of the matching degree between the first-class objects and the second-class objects.
[0083] Figure 3 A schematic diagram of a network architecture of an association detection network provided by at least one embodiment of the present disclosure is shown, based on which neural network training can be implemented, or the association relationship between a first type of object and a second type of object in an image can be detected. Figure 3 As shown, the association detection network may include:
[0084] The feature extraction network 31 is used to extract features from the image to obtain a feature map. In one example, the feature extraction network 31 may include a backbone network and FPN (Feature Pyramid Networks). After the image is processed by the backbone network and FPN in turn, the feature map can be extracted.
[0085] For example, the backbone network can use VGGNet, ResNet, etc., and FPN can convert the feature map obtained by the backbone network into a feature map of a pyramid multi-layer structure. The backbone network mentioned above is the image feature extraction part of the association detection network; FPN is equivalent to the Neck part in the network architecture, which performs feature enhancement processing and can enhance the shallow features extracted by the backbone.
[0086] The object detection network 32 is used to determine the first category of objects and the second category of objects in the image based on the feature map extracted from the image.
[0087] like Figure 3As shown, the object detection network 32 may include RPN (Region Proposal Network) and RCNN (Region-CNN), wherein RPN may predict an anchor box based on the feature map output by FPN, and RCNN may predict a detection box (bbox) based on the anchor box and the feature map output by FPN, wherein the detection box includes the first class object or the second class object. There may be multiple detection boxes output by RCNN.
[0088] The matching detection network 33 (Pair Head) is a neural network to be trained in the embodiment of the present disclosure, and is used to determine the first feature corresponding to the first class object and the second feature corresponding to the second class object based on the first class object or the second class object in the detection frame output by RCNN and the feature map output by FPN.
[0089] The object detection network 32 and the matching detection network 33 are equivalent to being located in the head part of the association detection network, which is the detector, and is used to output the detection result. The detection result in the embodiment of the present disclosure includes the first class of objects, the second class of objects and the corresponding association relationships.
[0090] It should be noted that the above-mentioned association detection network composed of the feature extraction network 31, the object detection network 32 and the matching detection network 33 is not limited to a specific network structure in the embodiment of the present disclosure. Figure 3 The structure shown is an example. For example, you can use Figure 3 Instead of using FPN in the image processing, the feature map extracted by backbone is directly passed through RPN / RCNN to determine the first or second class objects. For another example, Figure 3 The example shows a framework that uses two stages for detection. In actual implementation, one stage for detection can also be used.
[0091] based on Figure 3 The network structure of the association detection network shown in FIG. 1 is used as an example. In the following embodiment, the training process of the neural network (matching detection network 33) using the association detection network is described in detail.
[0092] In the disclosed embodiment, an image can be input into an association detection network, and a feature extraction network 31 extracts features from the image to obtain a feature map; an object detection network 32 detects and determines the detection frame corresponding to the first class object and the detection frame corresponding to the second class object in the image based on the feature map, thereby determining the first class object and the second class object in the image. A matching detection network 33, i.e., a neural network, generates at least one candidate object group based on the detected first class object and second class object, and determines the matching degree between the first class object and each second class object in the same candidate object group.
[0093] The specific implementation of the matching degree determination by the matching detection network 33 is that step 103 determines the matching degree between the first category object and each second category object in the same candidate object group based on the neural network, such as Figure 4 As shown, the following steps may be included:
[0094] Step 401: Determine a first feature of the first category of objects according to the feature map.
[0095] The matching detection network 33 can determine the first feature of the first category of objects based on the feature map extracted by the feature extraction network 31 and the detection box corresponding to the first category of objects output by the object detection network 32.
[0096] Step 402: Determine the second feature of each second category object in the candidate object group according to the feature map, and obtain a second feature set corresponding to the first feature.
[0097] The matching detection network 33 can determine the second feature corresponding to the second class object based on the feature map output by the feature extraction network 31 and the detection box corresponding to the second class object output by the object detection network 32. Based on the same principle, the second feature of each second class object in the candidate object group can be obtained to form a second feature set corresponding to the candidate object group.
[0098] Step 403: Concatenate each second feature in the second feature set with the first feature to obtain a concatenated feature set.
[0099] For each second feature in the second feature set, the matching detection network 33 can perform feature splicing of the second feature with the first feature to obtain a spliced feature of "first feature-second feature". The specific splicing method of splicing the first feature with the second feature is not limited by the embodiment of the present disclosure. In one possible implementation, when the first feature and the second feature are represented by feature vectors, the feature vector corresponding to the first feature can be directly spliced with the feature vector corresponding to the second feature, and the spliced feature vector is used as the splicing feature of the first category object and the second category object.
[0100] Step 404: Determine, based on the neural network, the degree of matching between the second category object and the first category object corresponding to the stitching features in the stitching feature set.
[0101] The matching detection network 33 can determine the matching degree between the corresponding first-category object and the second-category object according to the splicing features of the first-category object and the second-category object. In one possible implementation, the spliced feature vector can be input into a preset matching degree calculation function to calculate the matching degree between the corresponding first-category object and the second-category object. In another possible implementation, a matching degree calculation neural network that meets the requirements can be pre-trained using training samples; and when the matching degree needs to be calculated, the spliced feature vector is input into the matching degree calculation neural network, and the matching degree calculation neural network outputs the matching degree between the first-category object and the second-category object.
[0102] In the disclosed embodiment, a feature map of an image is extracted, and a first class of objects and a second class of objects in the image are determined based on the extracted feature map. When determining the degree of match between the first class of objects and the second class of objects, the first feature and the second feature determined based on the feature map may be spliced to obtain a spliced feature, and then the degree of match between the first class of objects and the second class of objects corresponding to the spliced feature may be determined based on a neural network. Thus, the association relationship between the first class of objects and the second class of objects in the image is detected and determined in the form of a candidate object group, which can improve detection efficiency.
[0103] After determining the degree of match between the first category object and each second category object in the same candidate object group, the disclosed embodiment can further calculate the group association loss based on the determined multiple matching degrees through a pre-set loss function. Then, the network parameters of the matching detection network 33 in the association detection network are adjusted according to the group association loss to achieve the training of the neural network. In a possible implementation, the network parameters of one or more of the feature extraction network 31, the object detection network 32, and the matching detection network 33 in the association detection network can be adjusted according to the group association loss to achieve the training of part or the entire association detection network.
[0104] In some optional embodiments, based on the specific method of the training process of the association detection network described above, a sufficient number of images can be used as training samples to train the association detection network to obtain an association detection network that meets the requirements. After completing the training of the association detection network, when it is necessary to detect the association relationship between the first category of objects and the second category of objects in a certain image to be tested, the image to be tested can be input into the pre-trained association detection network, and the association detection network outputs the matching degree between the first category of objects and the second category of objects in the image to be tested, and obtains the association result between the first category of objects and the second category of objects. Among them, the association detection network is a network trained according to the training method in any embodiment of the present disclosure.
[0105] It is understandable that the association results output by the association detection network can be presented in a variety of different forms. Figure 2 As the image to be tested, the association results can be output: human hands H1, H2-body B1; human hand H3-body B2; human hands H4, H5-body B3. Figure 2 As the image to be tested, the association results can be output: the matching degree of human hand H3-body B1 is 0.01; the matching degree of human hand H3-body B2 is 0.99; the matching degree of human hand H3-body B3 is 0.02... The presentation form of the above association results is only an exemplary description and does not constitute any limitation on the association results.
[0106] In some optional embodiments, after detecting the first category of objects and the second category of objects in the image, a third category of objects may also be detected from the image. The third category of objects is a human body part object that is different from the first category of objects or the second category of objects. For example, when the first category of objects is a human hand object and the second category of objects is a human body object, the third category of objects may be a human face object. In this embodiment, human hand objects, human body objects, and human face objects may be detected from the image.
[0107] In a possible implementation, the third class of objects includes a second human body part object. The second human body part object is a human body part different from the first human body part object. For example, the second human body part object includes a human hand object or a human face object. Exemplarily, when the first human body part object is a human hand object, the second human body part object may be a human face object or a human foot object.
[0108] When first, second and third category objects are detected from an image, this embodiment may generate at least one candidate object group based on the detected first, second and third category objects, wherein each candidate object group includes at least two third category objects.
[0109] For example, a candidate object group may be generated based on one first-category object, at least two second-category objects, and at least two third-category objects. Alternatively, a candidate object group may be generated based on at least two first-category objects, at least two second-category objects, and at least two third-category objects.
[0110] After determining the matching degrees between the first category objects and the second category objects in the same candidate object group based on the neural network, this embodiment further includes: determining the matching degrees between the first category objects and the third category objects in the same candidate object group based on the neural network.
[0111] When determining the group association loss corresponding to the candidate object group, the group association loss can be determined based on the matching degree between the first-class object and each second-class object in the same candidate object group, and then combined with the matching degree between the first-class object and each third-class object in the same candidate object group. The group association loss is positively correlated with the matching degree between the first-class object and the unrelated third-class object. Therefore, the matching degree between the first-class object and the unrelated third-class object can be suppressed by minimizing the loss function, and the distance between the first-class object and the unrelated third-class object can be pushed away.
[0112] In a possible implementation, the group association loss is also negatively correlated with the matching degree between the first-category object and the associated third-category object. By minimizing the loss function, the matching degree between the first-category object and the associated third-category object can be encouraged, thereby shortening the distance between the first-category object and the associated third-category object.
[0113] In the disclosed embodiment, the first class of objects, the second class of objects, and the third class of objects detected in the image are used to generate a candidate object group, and based on the matching degree between the first class of objects and the second class of objects and the third class of objects, the group association loss corresponding to the candidate object group is determined to adjust the network parameters of the neural network. The neural network trained in this way can simultaneously detect the matching degree between the first class of objects and the second class of objects and the third class of objects, respectively, so as to simultaneously determine the association relationship between the first class of objects, the second class of objects, and the third class of objects.
[0114] by Figure 2 For example, based on the neural network trained in this embodiment, Figure 2Detect and determine the association relationship between the hand object, the human body object and the face object. For example, it can be simultaneously determined that: the first-class objects human hands H1, H2, the second-class object human body B1, and the third-class object human face F1 have a correct association relationship among the three; the first-class object human hands H3, the second-class object human body B2, and the third-class object human face F2 have a correct association relationship among the three; the first-class objects human hands H4, H5, the second-class object human body B3, and the third-class object human face F3 have a correct association relationship among the three.
[0115] Based on the above disclosed method concept of training a neural network in the embodiment, refer to Figure 5 As shown, the present disclosure also provides a method for detecting associated objects. Figure 5 As shown, the method comprises the following steps:
[0116] Step 501: Detect first-category objects and second-category objects in an image.
[0117] In this step, the first category of objects and the second category of objects can be detected from the image that needs to be associated with the object.
[0118] In some optional embodiments, the first category of objects includes first human body part objects, and the second category of objects includes human body objects; or, the first category of objects includes human body objects, and the second category of objects includes first human body part objects. In a possible implementation, the first human body part objects include human face objects or human hand objects.
[0119] Step 502: Generate at least one object group based on the detected first-category objects and second-category objects, where the object group includes one first-category object and at least two second-category objects.
[0120] In the case where the first category object and the second category object are detected in the image, this step can generate an object group based on one first category object and at least two second category objects. Since the first category object detected in the image may include multiple objects, the object group generated based on the first category object may also include multiple objects.
[0121] The method of generating an object group based on the first-category object and the second-category object may include multiple implementations, which are not limited in this embodiment. In some optional embodiments, generating at least one object group based on the detected first-category object and the second-category object includes: performing a combination operation on the detected first-category object; the combination operation includes: combining the first-category object with any at least two detected second-category objects into one object group; or combining the first-category object with each detected second-category object into one object group.
[0122] In the above optional embodiment, after the first category object and the second category object in the image are detected, a combination operation may be performed to obtain a corresponding object group. For example, the first category object and any at least two detected second category objects may be combined to obtain a corresponding object group. Alternatively, the first category object and each detected second category object may be combined to obtain a corresponding object group.
[0123] by Figure 2 For example, Figure 2 The first category objects are detected: human hand H1, human hand H2, human hand H3, human hand H4 and human hand H5, and the second category objects are: human body B1, human body B2 and human body B3. In the above embodiment, the combination operation is performed on the first category object human hand H5. For example, any two of the second category objects are selected: human body B2 and human body B3, and combined with the first category object human hand H5 to obtain object group Group1 (human hand H5, human body B2 and human body B3). Alternatively, the first category object human hand H5 can be combined with the second category objects (human body B1, human body B2 and human body B3) detected to obtain object group Group2 (human hand H5, human body B1, human body B2 and human body B3).
[0124] In some optional embodiments, generating at least one object group based on the detected first-category objects and second-category objects includes: determining, based on the position information of the detected first-category objects and second-category objects, at least two second-category objects that satisfy a preset relative position relationship with the first-category objects as candidate associated objects of the first-category objects; and combining the first-category objects and each candidate associated objects of the first-category objects into an object group.
[0125] In the above embodiment, a relative position relationship can be preset, and at least two second-category objects that satisfy the relative position relationship with the first-category object are determined as candidate associated objects of the first-category object according to the position information of the first-category object and the second-category object. Figure 2 For example, the relative position relationship can be preset as follows: there is an overlapping area between the detection frames of the first type of object and the second type of object. Since there are overlapping areas between the detection frames of the hand H5 and the detection frames of the body B2 and the body B3, the body B2 and the body B3 can be used as candidate associated objects of the hand H5 in this embodiment. Furthermore, the hand H5, the body B2 and the body B3 can be combined into a candidate object group.
[0126] Step 503: Determine the matching degree between the first category objects and each second category object in the same object group.
[0127] After the object group is generated based on the first-category objects and the second-category objects, this step can determine the matching degree between the first-category objects and each second-category object in the same object group.
[0128] In some optional embodiments, determining the matching degree between the first category of objects and the second category of objects in the same object group includes: determining the matching degree between the first category of objects and the second category of objects in the same object group based on a pre-trained neural network; wherein the neural network is trained according to the neural network training method provided in any embodiment of the present disclosure. Exemplarily, the image to be detected for associated objects can be input as follows: Figure 3 The association detection network shown in the figure outputs the matching degree between the first category objects and each second category object in the same object group by means of a neural network (matching detection network 33).
[0129] Step 504: Determine the second category object associated with the first category object based on the matching degree between the first category object and each second category object in the same object group.
[0130] by Figure 2 For example, the same object group includes: human hand H5, human body B2 and human body B3. In this embodiment, the matching degrees between human hand H5 and human body B2 and human body B3 can be obtained: matching degree m1 and matching degree m2. This step can determine the corresponding association between human hand H5 and human body B3 based on the two determined matching degrees. In a possible implementation, the first type of object and the second type of object with the largest matching value in the same object group can be determined as a corresponding association relationship. Figure 2 When the matching degree m2 is greater than the matching degree m1, it can be determined that the human hand H5 corresponds to the human body B3.
[0131] In the embodiment of the present disclosure, based on the detection of first-category objects and second-category objects in an image, an object group is generated based on one first-category object and at least two second-category objects, and the matching degrees of the first-category objects with each second-category object in the same object group are determined, and the second-category objects associated with the first-category objects are determined based on the multiple matching degrees determined in the object group.
[0132] The associated object detection method can determine the second-category object associated with the first object from multiple second-category objects in the form of an object group. Compared with directly detecting the association relationship of a matching pair consisting of a first-category object and a second-category object, the global optimization of multiple matching pairs is achieved in the form of an object group, and the second-category object associated with the first-category object can be determined more accurately.
[0133] For scenes with multiple objects, especially scenes where there are occlusions or overlaps between multiple objects in an image, the method for detecting associated objects provided in this embodiment treats multiple first-category objects and second-category objects in an image that may have an associated relationship as detection objects in the same group in the form of object groups, and implements global optimization of the detection of associated relationships for multiple matching pairs of first-category objects and second-category objects in the image on the basis of object groups, thereby improving the accuracy of the calculation results of the matching degree between the first-category objects and the second-category objects.
[0134] In some optional embodiments, after detecting the first type of objects and the second type of objects in the graphic, a third type of objects in the image may also be detected. The third type of objects include second human body part objects. For example, the second human body part objects include human face objects or human hand objects.
[0135] Based on a first-category object, at least two second-category objects, and at least two third-category objects detected in the image, an object group is generated. Then, in the same object group, the matching degree between the first-category object and each second-category object is determined, and the matching degree between the first-category object and each third-category object is determined. Based on the matching degree between the first-category object and each second-category object in the same object group, the second-category object correspondingly associated with the first-category object is determined; based on the matching degree between the first-category object and each third-category object in the same object group, the third-category object correspondingly associated with the first-category object is determined.
[0136] In the above optional embodiment, when detecting associated objects, the second type of objects associated with the first type of objects and the third type of objects associated with the first type of objects in the image can be determined simultaneously, that is, the association detection method can simultaneously determine the association relationship between the first type of objects, the second type of objects and the third type of objects in the image, without having to separately detect the association relationship between the first type of objects and the second type of objects in the image, or separately detect the association relationship between the first type of objects and the third type of objects. For multi-object scenes, especially scenes where there are occlusions or overlaps between multiple objects in the image, this embodiment treats the first type of objects, the second type of objects and the third type of objects that may have an association relationship in the image as detection objects in the same group in the form of object groups, and simultaneously determines the association relationship between the first type of objects, the second type of objects and the third type of objects in the image based on the object groups.
[0137] Figure 6 As shown, the present disclosure provides a neural network training device, which can execute the neural network training method of any embodiment of the present disclosure. The device may include an object detection module 601, a candidate object group generation module 602, a matching degree determination module 603, a group association loss determination module 604 and a network parameter adjustment module 605. Among them:
[0138] An object detection module 601 is used to detect a first type of object and a second type of object in an image;
[0139] A candidate object group generating module 602, configured to generate at least one candidate object group based on the detected first category objects and second category objects, wherein the candidate object group includes at least one first category object and at least two second category objects;
[0140] A matching degree determination module 603, configured to determine the matching degrees between the first category objects and the second category objects in the same candidate object group based on a neural network;
[0141] A group association loss determination module 604 is used to determine the group association loss of the candidate object group according to the matching degree between the first category objects and each second category object in the same candidate object group, wherein the group association loss is positively correlated with the matching degree between the first category objects and the unrelated second category objects;
[0142] The network parameter adjustment module 605 is used to adjust the network parameters of the neural network according to the group association loss.
[0143] In some optional embodiments, the group association loss is also negatively correlated to the matching degree between the first category objects and the associated second category objects within the candidate object group.
[0144] In some optional embodiments, such as Figure 7 The device further includes: a training completion determination module 701, which is used to determine that the neural network has completed training when the group association loss is less than a preset loss value.
[0145] In some optional embodiments, the object detection module 601, when used to detect first-category objects and second-category objects in an image, includes: extracting a feature map of the image; determining first-category objects and second-category objects in the image based on the feature map; the matching degree determination module 603, when used to determine the matching degree between the first-category objects and each second-category object in the same candidate object group based on a neural network, includes: determining a first feature of the first-category objects based on the feature map; determining a second feature of each second-category object in the candidate object group based on the feature map to obtain a second feature set corresponding to the first feature; splicing each second feature in the second feature set with the first feature to obtain a spliced feature set; and determining, based on the neural network, the matching degree between the second-category objects corresponding to the spliced features in the spliced feature set and the first-category objects.
[0146] In some optional embodiments, each second-category object in the candidate object group satisfies a preset relative position relationship with the first-category object; or, a detection frame of each second-category object in the candidate object group has an overlapping area with a detection frame of the first-category object.
[0147] In some optional embodiments, the first category of objects includes first human body part objects, and the second category of objects includes human body objects; or, the first category of objects includes human body objects, and the second category of objects includes first human body part objects.
[0148] In some optional embodiments, the first human body part object includes a human face object or a human hand object.
[0149] In some optional embodiments, the object detection module 601 is also used to detect third-category objects in the image; the candidate object group generation module 602, when used to generate at least one candidate object group based on the detected first-category objects and second-category objects, includes: generating at least one candidate object group based on the detected first-category objects, second-category objects and third-category objects, each candidate object group also includes at least two of the third-category objects; the matching degree determination module 603 is also used to determine the matching degree between the first-category objects and each third-category objects in the same candidate object group based on a neural network; the group association loss is positively correlated with the matching degree between the first-category objects and non-associated third-category objects.
[0150] In some optional embodiments, the third category of objects includes second human body part objects.
[0151] Figure 8 As shown, the present disclosure provides a detection device for associated objects, which can execute the detection method for associated objects in any embodiment of the present disclosure. The device may include a detection module 801, an object group generation module 802, a determination module 803 and an associated object determination module 804. Among them:
[0152] A detection module 801, configured to detect a first type of object and a second type of object in an image;
[0153] An object group generating module 802, configured to generate at least one object group based on the detected first-category objects and second-category objects, wherein the object group includes one first-category object and at least two second-category objects;
[0154] A determination module 803 is used to determine the matching degree between the first category objects and the second category objects in the same object group;
[0155] The associated object determination module 804 is configured to determine the second category object associated with the first category object based on the matching degree between the first category object and each second category object in the same object group.
[0156] In some optional embodiments, the object group generation module 802, when used to generate at least one object group based on detected first-category objects and second-category objects, includes: performing a combination operation on the detected first-category objects; the combination operation includes: combining the first-category objects with any at least two detected second-category objects into one object group; or, combining the first-category objects with each detected second-category objects into one object group.
[0157] In some optional embodiments, the object group generation module 802, when used to generate at least one object group based on detected first-category objects and second-category objects, includes: determining, based on position information of the detected first-category objects and second-category objects, at least two second-category objects that satisfy a preset relative position relationship with the first-category objects as candidate associated objects of the first-category objects; and combining the first-category objects and each candidate associated object of the first-category objects into an object group.
[0158] In some optional embodiments, the first category of objects includes first human body part objects, and the second category of objects includes human body objects; or, the first category of objects includes human body objects, and the second category of objects includes first human body part objects.
[0159] In some optional embodiments, the first human body part object includes a human face object or a human hand object.
[0160] In some optional embodiments, the detection module 801 is also used to detect third-category objects in an image; the object group generation module 802, when used to generate at least one object group based on the detected first-category objects and second-category objects, includes: generating at least one object group based on the detected first-category objects, second-category objects and third-category objects, the object group also including at least two third-category objects; the determination module 803 is also used to determine the matching degree between the first-category objects and each third-category objects in the same object group; the associated object determination module 804 is also used to determine the third-category objects associated with the first-category objects based on the matching degree between the first-category objects and each third-category objects in the same object group.
[0161] In some optional embodiments, the third category of objects includes second human body part objects.
[0162] In some optional embodiments, the determination module 803, when used to determine the matching degree between the first category of objects and each second category of objects in the same object group, includes: determining the matching degree between the first category of objects and each second category of objects in the same object group based on a pre-trained neural network; wherein the neural network is obtained according to the neural network training method provided in any embodiment of the present disclosure.
[0163] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of at least one embodiment of the present disclosure. A person of ordinary skill in the art can understand and implement it without paying creative labor.
[0164] The present disclosure also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it can implement the neural network training method of any embodiment of the present disclosure, or implement the associated object detection method of any embodiment of the present disclosure.
[0165] Fig. 9 A more specific hardware structure diagram of a computer device provided by an embodiment of the present disclosure is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other in communication within the device through the bus 1050.
[0166] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0167] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0168] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0169] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0170] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0171] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0172] The present disclosure also provides a non-temporary computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the neural network training method of any embodiment of the present disclosure, or implement the associated object detection method of any embodiment of the present disclosure.
[0173] The non-temporary computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc., and the present disclosure is not limited thereto.
[0174] In some optional embodiments, the embodiments of the present disclosure provide a computer program product, including computer readable codes, and when the computer readable codes are executed on a device, a processor in the device executes a training method for a neural network according to any embodiment of the present disclosure, or a detection method for an associated object according to any embodiment of the present disclosure. The computer program product may be implemented in hardware, software, or a combination thereof.
[0175] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the inventions claimed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not claimed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0176] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
[0177] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure should be included in the scope of protection of the present disclosure.
Claims
1. A neural network training method, characterized in that: The method comprises: Detecting a first category of objects and a second category of objects in an image, wherein the first category of objects includes a first human body part object and the second category of objects includes a human body object; or, the first category of objects includes a human body object and the second category of objects includes the first human body part object; generating at least one candidate object group based on the detected first-category objects and second-category objects, wherein the candidate object group includes at least one first-category object and at least two second-category objects; Determining, based on a neural network, the matching degrees between the first category objects and the second category objects in the same candidate object group; determining a group association loss of the candidate object group based on the matching degrees of the first-category objects with each second-category object in the same candidate object group, wherein the group association loss is positively correlated with the matching degrees between the first-category objects and unrelated second-category objects; Adjusting network parameters of the neural network according to the group association loss; and detecting the first type of objects and the second type of objects in the image, comprising: extracting a feature map of the image; determining, according to the feature map, first-category objects and second-category objects in the image; The determining, based on the neural network, the matching degree between the first category objects and the second category objects in the same candidate object group includes: determining a first feature of the first category of objects according to the feature map; determining, based on the feature graph, a second feature of each second-category object in the candidate object group, and obtaining a second feature set corresponding to the first feature; Splicing each second feature in the second feature set with the first feature to obtain a spliced feature set; Based on the neural network, a degree of matching between the second category of objects and the first category of objects corresponding to the splicing features in the splicing feature set is determined.
2. The method according to claim 1, characterized in that The group association loss is also negatively correlated with the matching degree between the first category objects and the associated second category objects within the candidate object group.
3. The method according to claim 1 or 2, characterized in that The method further comprises: When the group association loss is less than a preset loss value, it is determined that the neural network has completed training.
4. The method according to claim 1 or 2, characterized in that Each of the second-category objects in the candidate object group meets a preset relative position relationship with the first-category objects; or, The detection frames of the second-category objects in the candidate object group overlap with the detection frames of the first-category objects.
5. The method according to claim 1, characterized in that The first human body part object includes a human face object or a human hand object.
6. The method according to claim 1 or 2, characterized in that The method further comprises: detecting a third class of objects in the image; generating at least one candidate object group based on the detected first-category objects, second-category objects, and third-category objects, each candidate object group further comprising at least two objects of the third category; The method further includes: determining, based on a neural network, a degree of matching between the first category objects and respective third category objects in the same candidate object group; And the group association loss is also positively correlated with the matching degree between the first category objects and the unrelated third category objects.
7. The method according to claim 6, characterized in that The third category of objects includes second human body part objects.
8. A method for detecting associated objects, characterized in that: include: Detecting a first category of objects and a second category of objects in an image, wherein the first category of objects includes a first human body part object and the second category of objects includes a human body object; or, the first category of objects includes a human body object and the second category of objects includes the first human body part object; generating at least one object group based on the detected first-category objects and second-category objects, wherein the object group includes one first-category object and at least two second-category objects; Determining, based on the neural network trained by the method of claim 1, a degree of matching between the first category of objects and each second category of objects in the same object group; The second-category object associated with the first-category object is determined based on the matching degree between the first-category object and each second-category object in the same object group.
9. The method according to claim 8, characterized in that Generating at least one object group based on the detected first-category objects and second-category objects includes: Performing a combination operation on the first type of objects detected; The combined operation includes: The first-category objects and any at least two detected second-category objects are combined into an object group.
10. The method according to claim 8 or 9, characterized in that Generating at least one object group based on the detected first-category objects and second-category objects includes: determining, based on the detected position information of the first-category object and the second-category object, at least two second-category objects that satisfy a preset relative position relationship with the first-category object as candidate associated objects of the first-category object; The first category of objects and each candidate associated object of the first category of objects are combined into an object group.
11. The method according to claim 8, characterized in that The first human body part object includes a human face object or a human hand object.
12. The method according to claim 8, characterized in that The method further includes: detecting a third type of object in the image; generating at least one object group based on the detected first-category objects, second-category objects, and third-category objects, wherein the object group further includes at least two third-category objects; The method further comprises: Determining the matching degree between the first category objects and each third category object in the same object group; The third-category object associated with the first-category object is determined based on the matching degree between the first-category object and each third-category object in the same object group.
13. The method according to claim 12, characterized in that The third category of objects includes second human body part objects.
14. A detection device for associated objects, characterized in that: include: a detection module, configured to detect a first category of objects and a second category of objects in an image, wherein the first category of objects includes first human body part objects and the second category of objects includes human body objects; or the first category of objects includes human body objects and the second category of objects includes first human body part objects; an object group generating module, configured to generate at least one object group based on the detected first-category objects and second-category objects, wherein the object group includes one first-category object and at least two second-category objects; a determination module, configured to determine, based on the neural network trained by the method according to claim 1, a degree of matching between the first category objects and respective second category objects in the same object group; The associated object determining module is configured to determine a second-category object associated with the first-category object based on a matching degree between the first-category object and each second-category object in the same object group.
15. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 13 is implemented.
16. A neural network training device, characterized in that: The device comprises: an object detection module, configured to detect a first category of objects and a second category of objects in an image, wherein the first category of objects includes a first human body part object and the second category of objects includes a human body object; or, the first category of objects includes a human body object and the second category of objects includes the first human body part object; a candidate object group generating module, configured to generate at least one candidate object group based on the detected first-category objects and second-category objects, wherein the candidate object group includes at least one first-category object and at least two second-category objects; a matching degree determination module, configured to determine, based on a neural network, the matching degrees between the first category objects and the second category objects in the same candidate object group; a group association loss determination module, configured to determine a group association loss for the candidate object group based on a matching degree between each of the first-category objects and each of the second-category objects in the same candidate object group, wherein the group association loss is positively correlated with a matching degree between the first-category objects and unrelated second-category objects; A network parameter adjustment module, configured to adjust network parameters of the neural network according to the group association loss; The detecting of the first type of objects and the second type of objects in the image comprises: extracting a feature map of the image; determining, according to the feature map, first-category objects and second-category objects in the image; The determining, based on the neural network, the matching degree between the first category objects and the second category objects in the same candidate object group includes: determining a first feature of the first category of objects according to the feature map; determining, based on the feature graph, a second feature of each second-category object in the candidate object group, and obtaining a second feature set corresponding to the first feature; Splicing each second feature in the second feature set with the first feature to obtain a spliced feature set; Based on the neural network, a degree of matching between the second category of objects and the first category of objects corresponding to the splicing features in the splicing feature set is determined.
17. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.
Citation Information
Patent Citations
Neural network training and object recognition method, apparatus and system, and storage medium
CN109241888A
A vehicle re-identification method integrating visual appearance and space-time constraint
CN109740653A
Image recognition method and device and convolutional neural network training method and device
CN109784415A
Image recognition method and device, computer device and storage medium
CN110689046A
Target tracking network training method and device, target tracking method and device, electronic equipment and medium
CN110766724A
