Image processing method, image processing device, equipment and storage medium

By extracting and interacting with sample features and image features to be processed, a unified algorithm process is used to complete a variety of instance sensing tasks, solving the problems of task complexity and low efficiency in the existing technology, and achieving simplification and efficiency improvement of instance sensing tasks.

CN118570618APending Publication Date: 2024-08-30SHENZHEN SENSETIME TECH CO LTD

Patent Information

Application Number
CN202410490964.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-22
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

When the existing technology handles instance awareness tasks, it is necessary to set up different algorithm processes for different tasks, resulting in processing complexity and low efficiency, and it is impossible to uniformly complete multiple instance awareness tasks.

Method used

By extracting the sample features of the target task and interacting with the features of the image to be processed, a unified algorithm process is used to complete a variety of instance perception tasks, including instance detection, instance segmentation, pose estimation, etc., and decoding processing and feature enhancement are used to achieve prediction results. accuracy.

Benefits of technology

It simplifies the processing process of instance awareness tasks, can complete multiple instance awareness tasks in a unified manner, improves processing efficiency and accuracy, and reduces the need for specific algorithm processes for different tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570618A
    Figure CN118570618A
Patent Text Reader

Abstract

The invention discloses an image processing method, an image processing device, equipment and a storage medium. The image processing method comprises the following steps: acquiring a first sample image; a first sample feature about a target task is extracted from the first sample image, the target task is any one of a plurality of preset tasks, and the preset tasks are instance sensing tasks; and obtaining a prediction result of the to-be-processed image for the target task based on the first sample feature and the to-be-processed feature of the to-be-processed image. According to the scheme, a unified algorithm process is adopted, different instance sensing tasks can be completed, and processing of the instance sensing tasks is simplified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence processing, and in particular to an image processing method, an image processing apparatus, a device and a storage medium. Background Art

[0002] Instance perception tasks are a large class of important visual tasks with a wide range of applications, aiming to perceive instances in images. Instance perception tasks can include multiple different tasks, for example, instance detection, instance segmentation, etc.

[0003] Since there are certain differences between different tasks, when processing instance perception tasks, specific algorithm flows are usually constructed for different tasks. The algorithm flow constructed for a specific task is only applicable to that task and cannot be applied to other tasks, which makes instance perception tasks more complicated to handle. Summary of the invention

[0004] The present application at least provides an image processing method, an image processing apparatus, a device and a storage medium.

[0005] The present application provides an image processing method, comprising: acquiring a first sample image; extracting a first sample feature about a target task from the first sample image, wherein the target task is any one of a plurality of preset tasks, and the preset task is an instance perception task; and obtaining a prediction result of the image to be processed for the target task based on the first sample feature and the feature to be processed of the image to be processed.

[0006] In the above scheme, the first sample image is used to extract the first sample feature about the target task, which is used to indicate the processing of the corresponding target task, so that the prediction result of the image to be processed for the target task can be obtained, and any one of the multiple preset tasks can be used as the target task. There is no need to set different algorithm flows for different tasks. A unified algorithm flow can be used to complete different instance perception tasks, which simplifies the processing of instance perception tasks.

[0007] Among them, based on the first sample feature and the feature to be processed of the image to be processed, obtaining the prediction result of the image to be processed for the target task includes: performing at least one decoding process on the first sample feature and the feature to be processed in sequence, wherein the input feature of each decoding process includes the original task feature and the feature to be processed, the original task feature of the first decoding process is the first sample feature, and the original task feature of the non-first decoding process is the output feature obtained by the last decoding process; based on the output feature of the last decoding process, obtaining the prediction result of the image to be processed for the target task.

[0008] In the above scheme, at least one decoding process is set so that the first sample feature involved in the decoding process interacts with the feature to be processed, and the first sample feature contains information of the target task, thereby achieving a prediction result of the image to be processed for the target task.

[0009] Among them, each decoding process includes: based on the original task features of this decoding process, obtaining the updated task features corresponding to the target task in this decoding process, fusing the updated task features with the features to be processed, and obtaining the output features of this decoding process; or, fusing the original task features with the features to be processed to obtain the output features of this decoding process.

[0010] In the above scheme, each decoding process fuses the task features with the features to be processed to obtain features containing the image to be processed and the target task information, wherein the original task features are transformed to obtain updated task features, which can more accurately represent the features of the target task.

[0011] Wherein, based on the original task features of this decoding process, obtaining the updated task features corresponding to the target task in this decoding process includes: enhancing the features of the original task features for the target task to obtain the updated task features.

[0012] In the above scheme, through feature enhancement, updated task features that can more accurately represent the target task features are obtained.

[0013] Among them, the original task features or the updated task features are used as task features, and the task features and the features to be processed are fused to obtain the output features of this decoding process, including: taking the features to be processed as key features and value features, and the task features as query features, and using the key features, value features and query features for cross-attention processing to obtain the output features.

[0014] In the above scheme, the interaction between the task features and the features to be processed is realized through cross-attention processing, so that the output features carry the characteristics of the target task and the image to be processed.

[0015] Among them, based on the output features of the last decoding process, obtaining the prediction result of the image to be processed for the target task includes: regressing the output features of the last decoding process to obtain the first prediction key point for the target task in the image to be processed as the prediction result.

[0016] In the above scheme, the output features are regressed to obtain the first predicted key points about the instance for the target task, thereby realizing perception of the instance.

[0017] Among them, the first sample image is annotated with a first label corresponding to the target task, and the first label includes several first real key points associated with the instances; extracting the first sample feature about the target task from the first sample image includes: performing feature extraction on the first sample image to obtain the first extracted feature; according to the first label, extracting the point features corresponding to each first real key point from the first extracted feature; and obtaining the first sample feature based on the point features corresponding to each first real key point.

[0018] In the above solution, the first label corresponds to the target task, and the first sample feature obtained by extraction based on the first label can represent the feature of the target task.

[0019] Among them, according to the first label, extracting the point features corresponding to each first real key point from the first extracted features includes: fusing the first extracted features with the position code to obtain a fusion result; performing bilinear interpolation on the fusion result according to the position information of each first real key point to obtain the point features corresponding to each first real key point.

[0020] In the above solution, interpolation is performed based on the position information, so as to obtain accurate point features of the first real key point.

[0021] Among them, obtaining the first sample feature based on the point features corresponding to each first real key point includes: in response to the existence of an instance in the first sample image, taking the point features corresponding to each first real key point as the first sample feature; in response to the existence of multiple instances in the first sample image, respectively counting all point features corresponding to each key point group to obtain the statistical features corresponding to each key point group as the first sample feature, each key point group contains a first real key point associated with each instance, and there is a corresponding relationship between all the first real key points in the same key point group.

[0022] In the above solution, when there are one or more instances of the first sample image, the first sample feature can be determined.

[0023] Among them, before obtaining the prediction result of the image to be processed for the target task based on the first sample feature and the feature to be processed of the image to be processed, the method also includes: determining an instance-based candidate area in the image to be processed; extracting regional features of the candidate area; and performing dimensional transformation on the regional features of the candidate area to obtain at least one one-dimensional feature as the feature to be processed.

[0024] In the above scheme, features to be processed are extracted from candidate regions based on instances, which reduces the amount of data and the amount of computation required for subsequent processing, thereby improving efficiency.

[0025] Among them, determining the instance-based candidate area in the image to be processed includes: performing instance detection on the second extracted feature of the image to be processed to obtain the instance-based candidate area in the image to be processed; extracting the regional features of the candidate area includes: performing target pooling processing on the features within the candidate area in the second extracted feature to obtain the regional features of the candidate area.

[0026] In the above scheme, through instance detection and target pooling, it is possible to extract regional features about the instance from the image to be processed, thereby reducing the amount of data while maintaining focus on the instance.

[0027] Among them, multiple preset tasks include one or more of instance detection, instance segmentation, posture estimation, and instance counting. The preset tasks are expressed in the form of key points associated with instances; the key points corresponding to instance detection are the boundary points of the instance detection box; the key points corresponding to instance segmentation are the boundary points of the instance mask; the key points corresponding to posture estimation are the semantic key points of the instance; and the key points corresponding to instance counting are the identification points of the instance.

[0028] In the above scheme, key points are used to represent instances for different tasks, and different tasks are unified to facilitate unified processing, so that a unified algorithm flow can be adopted to complete different image processing tasks.

[0029] Among them, the boundary points of the instance detection box are a first preset number of points evenly distributed on the boundary of the instance detection box; the boundary points of the instance mask are a second preset number of points evenly distributed on the boundary of the instance mask; the semantic key points are a third preset number; and the identification points are a fourth preset number of points associated with the instance detection box.

[0030] In the above scheme, different key points are set for different tasks, and different tasks are distinguished under the premise of unified key point representation.

[0031] Among them, the identification point is the center point of the instance detection box.

[0032] In the above scheme, the center point of the instance detection box is used as the identification point to facilitate counting processing.

[0033] In which, the prediction result of the target task is obtained by using an image processing model, and the method also includes the following steps to train the image processing model: obtaining a pair of sample images corresponding to at least one sample task, the sample image pair including a second sample image and a third sample image, the second sample image and the third sample image are respectively annotated with a second label and a third label of the corresponding sample task; at least one sample task includes at least one of a plurality of preset tasks; for each sample task, using the image processing model, extracting a second sample feature about the sample task from the third sample image; based on the second sample feature and the second sample image, obtaining a sample prediction result of the second sample image for the sample task; based on the difference between the sample prediction result and the second label, obtaining a target loss for the sample task; and using the target loss of each sample task to adjust the parameters of the image processing model.

[0034] In the above scheme, multiple sample tasks are used for training, so that the model can learn common knowledge in different sample tasks, so that it can be subsequently applied to a variety of different tasks, including tasks that did not appear during the training process.

[0035] Among them, the sample task is represented in the form of key points associated with an instance, and the number of key points associated with an instance is multiple. Based on the difference between the sample prediction result and the second label, the target loss of the sample task is obtained, including: based on the difference between the predicted value of the key point in the sample prediction result about the neighborhood structure representation information and the true value of the corresponding key point in the second label about the neighborhood structure representation information, the loss parameter corresponding to the key point is obtained; the loss parameters corresponding to each key point in the sample prediction result are counted to obtain the target loss of the sample task.

[0036] In the above scheme, setting the neighborhood structure representation information to obtain the loss can reduce the error caused by point annotation noise.

[0037] Among them, one key point corresponds to a fifth preset number of neighborhood point pairs, the neighborhood point pair includes two neighborhood points associated with the same instance as the key point, and the neighborhood point and the key point are separated by a sixth preset number of points, and the sixth preset numbers corresponding to different neighborhood point pairs are different; the key point in the sample prediction result is the second predicted key point, the neighborhood point pair of the second predicted key point is the predicted neighborhood point pair, the key point in the second label is the second real key point, and the neighborhood point pair of the second real key point is the real neighborhood point pair; based on the predicted value of the key point in the sample prediction result about the neighborhood structure representation information, and the corresponding key point in the second label about the neighborhood structure representation information The difference between the true value and the loss parameter corresponding to the key point is obtained by: respectively performing preset processing on the target angle formed by the second predicted key point and each predicted neighborhood point pair to obtain the predicted value corresponding to each predicted neighborhood point pair; and respectively performing preset processing on the target angle formed by the second real key point and each real neighborhood point pair to obtain the true value corresponding to each real neighborhood point pair; obtaining the difference between the predicted value and the true value corresponding to each group of neighborhood point groups, and taking the central tendency statistical value of the difference corresponding to each group of neighborhood point groups as the loss parameter of the second predicted key point, each group of neighborhood point groups includes a corresponding predicted neighborhood point pair and a real neighborhood point pair.

[0038] In the above scheme, the neighborhood structure representation information can be obtained by pre-setting the target angle formed between the key point and each predicted neighborhood point pair, and the structural information is represented by the neighborhood angle to reduce the error caused by point annotation noise.

[0039] Among them, the preset processing includes using the angle value of the target angle as the neighborhood structure representation information corresponding to the neighborhood point pair; or, the gradient of the loss parameter obtained after the preset processing decreases as the angle value of the target angle increases.

[0040] In the above scheme, the angle value is directly used as the neighborhood structure representation information to reduce the error caused by point annotation noise. Alternatively, the gradient of the loss parameter obtained after the preset processing decreases as the angle value of the target angle increases, amplifying the gradient at the peak and weakening the gradient in the flat area, effectively capturing detailed shape information.

[0041] Wherein, the target angle is 0 degrees to 180 degrees, and / or, the preset processing includes using the sine value of the target angle as the neighborhood structure characterization information corresponding to the neighborhood point pair, and the target angle is half of the angle value of the target angle.

[0042] In the above scheme, an angle of 0 to 180 degrees formed by three points is selected as the target angle, and the sine value of half the target angle is used as the neighborhood structure representation information corresponding to the neighborhood point pair, which can achieve that the gradient of the loss parameter decreases with the increase of the angle value of the target angle.

[0043] The present application provides an image processing device, including an acquisition module, an extraction module and a prediction module, wherein the acquisition module is used to acquire a first sample image; the extraction module is used to extract a first sample feature about a target task from the first sample image, wherein the target task is any one of a plurality of preset tasks, and the preset task is an instance perception task; the prediction module is used to obtain a prediction result of the image to be processed for the target task based on the first sample feature and the feature to be processed of the image to be processed.

[0044] The present application provides an electronic device, including a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement any of the above-mentioned image processing methods.

[0045] The present application provides a computer-readable storage medium on which program instructions are stored. When the program instructions are executed by a processor, any of the above-mentioned image processing methods is implemented.

[0046] In the above scheme, any one of the multiple preset tasks can be used as the target task. There is no need to set different algorithm processes for different tasks. Using a unified algorithm process can also complete different instance perception tasks.

[0047] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.

[0049] Figure 1 It is a flowchart of an embodiment of the image processing method of the present application;

[0050] Figure 2 This application Figure 1 A flowchart of another embodiment of step S130;

[0051] Figure 3 is a flowchart of another embodiment of the decoding process of the present application;

[0052] Figure 4 This application Figure 1 A flowchart of another embodiment of step S120;

[0053] Figure 5 is a schematic diagram of another embodiment of the image processing method of the present application;

[0054] Figure 6 is a flowchart of another embodiment of the image processing method of the present application;

[0055] Figure 7 This application Figure 6 A flowchart of another embodiment of step S640;

[0056] Figure 8 is a schematic diagram of another embodiment of the image processing method of the present application;

[0057] Fig. 9 It is a schematic diagram of the framework of an embodiment of the image processing device of the present application;

[0058] Fig.10 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application;

[0059] Fig.11 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION

[0060] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.

[0061] In the following description, for the purpose of explanation rather than limitation, specific details such as specific subsystem structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.

[0062] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship. In addition, "many" in this article means two or more than two. In addition, the term "at least one" in this article means any combination of at least two of any one or more of a plurality of, for example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B, and C.

[0063] See also Figure 1 , Figure 1 It is a flowchart of an embodiment of the image processing method of the present application.

[0064] Specifically, the method may include:

[0065] Step S110: Acquire a first sample image.

[0066] It can be understood that the image processing method provided in the present application can be used to obtain the processing result of the image to be processed, and the first sample image can also be used in the processing process.

[0067] In an implementation scenario, the first sample image and the image to be processed may be determined based on a user operation. For example, they may be determined in response to a user selection operation, or an image uploaded by a user may be obtained as the first sample image or the image to be processed.

[0068] In some embodiments, for an image to be processed, there may be one or more first sample images. In a process of one image processing, the multiple first sample images correspond to the same task.

[0069] Step S120: extracting first sample features related to the target task from the first sample image.

[0070] The target task may be any one of a plurality of preset tasks.

[0071] In a specific application scenario, the preset task may be an instance perception task, which may be used to perceive an instance in an image, that is, to perceive an object in an image. The specific contents of the plurality of preset tasks may be set according to actual application needs.

[0072] It should be noted that different preset tasks in the present application can be used to perceive instances from different angles. Exemplarily, the multiple preset tasks may include one or more of instance detection, instance segmentation, posture estimation, and instance counting. The preset tasks may also not be limited to the aforementioned examples, and may be specifically set according to actual application needs.

[0073] The first sample feature is extracted from the first sample image and is a feature related to the target task and can be used to characterize the target task.

[0074] Step S130: Based on the first sample feature and the feature to be processed of the image to be processed, a prediction result of the image to be processed for the target task is obtained.

[0075] The first sample feature is a feature related to the target task, and can characterize the feature of the target task, so that the first sample feature can be used to indicate the processing of the corresponding target task. Based on the first sample feature and the feature to be processed of the image to be processed, the prediction result corresponding to the image to be processed under the target task can be obtained.

[0076] Exemplarily, the target task may be instance detection. Then, based on the first sample feature and the feature to be processed, a prediction result of the image to be processed for instance detection may be obtained, that is, a result of detecting instances existing in the image to be processed.

[0077] Exemplarily, the target task may be instance counting. Then, based on the first sample feature and the feature to be processed, a prediction result of the instance counting of the image to be processed may be obtained, that is, a result of counting the instances existing in the image to be processed.

[0078] In the above method, the first sample image is used to extract the first sample feature about the target task, which is used to indicate the processing of the corresponding target task, so that the prediction result of the image to be processed for the target task can be obtained. Any one of the multiple preset tasks can be used as the target task. There is no need to set different algorithm flows for different tasks. Different image processing tasks can be completed by using a unified algorithm flow.

[0079] In some embodiments, the above steps S110 to S130 can be implemented using an image processing model, which is a general model applicable to multiple preset tasks. There is no specific structure for a specific task in the image processing model, and a unified processing framework is used for all tasks.

[0080] See also Figure 2 , Figure 2 This application Figure 1 Schematic diagram of another embodiment of step S130 in FIG. 1 . Specifically, this step may include:

[0081] Step S231: performing at least one decoding process on the first sample feature and the feature to be processed in sequence.

[0082] The input features of each decoding process include original task features and features to be processed. The original task features of the first decoding input are the first sample features, and the original task features of the input of the non-first decoding process are the output features obtained by the previous decoding process.

[0083] Among them, the features to be processed of each decoding process input remain unchanged.

[0084] During the decoding process, there is interaction between the first sample features and the features to be processed, so that the features of the decoded output carry both the features of the target task and the features of the image to be processed.

[0085] The output features of a decoding process are obtained based on the input features. The input features include the original task features that can characterize the target task features, so that the output features can carry the features of the target task. The output features of the previous time can be used as the original task features of the next input, so that the features of the target task are transmitted in multiple decoding processes.

[0086] Step S232: Based on the output features of the last decoding process, a prediction result of the image to be processed for the target task is obtained.

[0087] It should be noted that the first sample feature that can characterize the target task feature and the feature to be processed are used as the input of decoding, and the first sample feature is used through decoding to instruct the feature to be processed to process the corresponding target task. The output feature of the last decoding process contains the information required to achieve the target task in the image to be processed, and can be used to obtain the prediction result of the image to be processed for the target task.

[0088] In some embodiments, obtaining a prediction result of the image to be processed for the target task based on the output features of the last decoding process may include: regressing the output features of the last decoding process to obtain the first predicted key point of the image to be processed regarding the target task as the prediction result.

[0089] Specifically, the preset task is represented in the form of key points associated with the instance. Specifically, in its label and expected prediction result, for an instance, the instance is represented in the form of key points associated with the instance. For example, the boundary points of the instance detection box are used to represent the location of the instance. Instance perception can be achieved in the form of key points, and regression is performed to obtain the location information of the first predicted key point, for example, the coordinates of the first predicted key point in the image to be processed.

[0090] In a specific application scenario, the first predicted key point is a key point about an instance in the image to be processed. Further, the image to be processed may include one or more instances, and the first predicted key point includes a first predicted key point of each instance.

[0091] In a specific application scenario, a multi-layer perceptron can be used to regress the output features of the last decoding process.

[0092] In some embodiments, each decoding process may include fusing the original task features and the features to be processed to obtain the output features of this decoding process. The specific means of fusion can be set according to actual application needs.

[0093] See also Figure 3 , Figure 3 This is a flowchart of another embodiment of the decoding process of the present application. Specifically, for a decoding process, it may include:

[0094] Step S310: Based on the original task features of this decoding process, obtain the updated task features corresponding to the target task in this decoding process.

[0095] The description of step S310 and step S320 may refer to the relevant content about step S231 in the aforementioned embodiment.

[0096] Among them, the original task features can be further transformed with respect to the features of the target task to obtain updated task features that more accurately characterize the target task.

[0097] In some embodiments, the original task features may be enhanced for the target task to obtain updated task features, wherein the feature enhancement method may be selected according to actual application requirements.

[0098] In a specific application scenario, self-attention processing is used as a means of feature enhancement. The original task features are used as key features, value features, and query features, and self-attention processing is performed to obtain updated task features.

[0099] Step S320: Fusing the update task features and the features to be processed to obtain output features of this decoding process.

[0100] Furthermore, the update task features and the features to be processed can be fused and interacted to obtain output features, so that the output features can also represent the features of the target task. The means of fusing and interacting the two features can be set according to actual application needs.

[0101] In some embodiments, the original task features or updated task features need to be fused with the features to be processed. Specifically, the fusion can be to use the features to be processed as key features and value features, and the task features as query features, where the task features can be the original task features or the updated task features, and the key features, value features and query features are used to perform cross-attention processing to obtain output features.

[0102] In a specific application scenario, the features to be processed can be used as key features and value features, and the update task features can be used as query features. The key features, value features, and query features can be used for cross-attention processing to obtain output features. Thus, the output features can represent the features related to the target task in the image to be processed.

[0103] In some embodiments, key points may be used to implement instance perception, and each instance in a label and a prediction result corresponding to a preset task may be represented by a key point associated with the instance.

[0104] It is understandable that the key points associated with the instance may be set differently for different preset tasks. Exemplarily, for instance detection, the goal is to obtain the position of the instance at the bounding box level, and the key points associated with the instance may be the boundary points of the instance detection box. For instance segmentation, the goal is to obtain the mask at the pixel level, and the key points associated with the instance may be the boundary points of the instance mask. For posture estimation, the posture is determined by semantic key points, and the key points associated with the instance may be the semantic key points of the instance. For instance counting, the goal is to obtain the number of instances, and the key points associated with the instance may be the identification points of the instance, which can be used to distinguish different instances.

[0105] The above preset tasks are only examples. Other preset tasks can be set according to actual application needs, and key points different from those in the previous examples can be set to represent instances.

[0106] In a specific application scenario, the instance detection task is a basic task in computer vision, and its goal is to obtain the bounding box level position of the instance. An instance can be represented by a first preset number of points evenly distributed on the boundary of the instance detection box. Exemplarily, 16 points are used to describe the boundary of an instance detection box, and these points are evenly sampled in the entire box.

[0107] In a specific application scenario, segmentation requires a pixel-level mask, and a second preset number of points evenly distributed on the boundary of the instance mask can be used to represent an instance. Exemplarily, 32 points are used to describe the mask boundary of each instance.

[0108] Further, points are uniformly added or deleted on the initial outline of the mask until the desired number of points is reached.

[0109] The above multiple key points are evenly distributed along a certain boundary. For example, the even distribution can be that the distance between each pair of adjacent key points on the boundary is the same. Of course, multiple boundary points can also be arranged in a non-even distribution. In addition, a starting key point can be selected from all the key points, and the key points on the boundary can be numbered in sequence in a clockwise or counterclockwise direction starting from the starting key point.

[0110] In a specific application scenario, posture estimation is to detect the position information of the semantic key points of the instance, and a third preset number of semantic key points can be used to describe an instance.

[0111] In a specific application scenario, instance counting is to obtain the number of instances, and a fourth preset number of points associated with the instance detection box may be used to describe an instance, wherein the fourth preset number may be any value.

[0112] Further, for the convenience of statistics, the fourth preset number can be set to 1. Exemplarily, the center point of the instance detection frame is used as the identification point of the instance. By counting the identification points, the number of instances can be obtained.

[0113] Of course, other points related to the instance may also be used as identification points of the instance, and examples are not given one by one here.

[0114] It can be understood that the number of key points corresponding to the above example (the first preset number, the second preset number, the third preset number, the fourth preset number) can be set according to actual application needs.

[0115] It is understandable that different preset tasks perceive instances from different angles, so the number and position of key points set for different preset tasks can be different. Among them, the key points of instance detection are actually points on the background, the key points of instance segmentation are points on the edge of the instance, and the key points of pose estimation and instance counting are points inside the instance. Among them, the number of key points for pose estimation can be multiple, and the number of key points for instance counting can be one.

[0116] See also Figure 4 , Figure 4 This application Figure 1 Schematic diagram of another embodiment of step S120 in FIG. 1 . Specifically, this step may include:

[0117] Step S421: extracting features from the first sample image to obtain first extracted features.

[0118] Specifically, a feature extractor may be used to extract features from the first sample image.

[0119] The first sample image is annotated with a first label corresponding to the target task, the first label includes a plurality of first real key points associated with the instance, and the first label is represented in the form of key points associated with the instance.

[0120] In a specific application scenario, an image uploaded by a user is obtained as a first sample image, and in response to a click operation of the user, key points in the first sample image are determined as first tags.

[0121] It should be noted that the first sample image may be one or more images, and each first sample image corresponds to its first label. A first sample image may include one or more instances, and each instance will be labeled.

[0122] The first label includes first real key points associated with several instances, wherein the several instances may be from one or more first sample images.

[0123] Step S422: extracting point features corresponding to each first real key point from the first extracted features according to the first label.

[0124] The extracted point features are one-dimensional features. Specifically, the first label may include the position information of each first real key point, and the features at the corresponding positions are extracted according to the position information as the point features.

[0125] In a specific application scenario, extracting point features may include: fusing the first extracted features with the position code to obtain a fusion result, and interpolating the fusion result according to the position information of each first real key point to obtain point features corresponding to each first real key point.

[0126] In a specific application scenario, the position encoding may be a sinusoidal position representation, and the interpolation may be performed using a bilinear interpolation method.

[0127] Step S423: Obtain first sample features based on the point features corresponding to each first real key point.

[0128] If there is only one instance in the first sample image, then the point features of each first real key point can be directly used as the first sample feature.

[0129] If there are multiple instances in the first sample image, each instance will be annotated in the form of the first real key point. For the same task, each instance uses the same number of key points, and there is a corresponding relationship between the key points of different instances. For example, for all instances, a key point is set at the upper left corner of the instance detection box, and a key point is set at the lower right corner of the instance detection box.

[0130] The key points can be grouped according to the correspondence between the first real key points, each key point group includes a first real key point associated with each instance, and there is a correspondence between all the first real key points in the same group. All point features corresponding to each key point group are counted respectively to obtain the statistical features corresponding to each key point group as the first sample features.

[0131] In a specific application scenario, the statistical feature may be the average value of all point features.

[0132] In some embodiments, before obtaining a prediction result based on the first sample feature and the feature to be processed, the method also includes the following steps to obtain the feature to be processed: determining an instance-based candidate area in the image to be processed, extracting regional features of the candidate area, and performing a dimensional transformation on the regional features of the candidate area to obtain at least one one-dimensional feature as the feature to be processed.

[0133] Among them, the regional features are two-dimensional feature maps, which are straightened into a series of one-dimensional features as features to be processed.

[0134] In some embodiments, after obtaining the region features of the candidate region, the region features may be classified to obtain classification results of instances in the candidate region, and the classification results may be used to obtain output results. For example, the number of instances of each category may be obtained.

[0135] It should be noted that the features to be processed are extracted based on the image to be processed and are related to the instances contained in the image to be processed, so as to further determine the prediction results of the instance perception task of the image to be processed based on the features to be processed.

[0136] The feature to be processed includes at least one one-dimensional feature. The first sample feature includes at least one point feature, which is also a one-dimensional feature. The feature to be processed and the first sample feature have the same spatial size, and the two can also be aligned in the channel dimension to facilitate subsequent decoding processing.

[0137] In some embodiments, before determining the candidate region, the method may further include: performing feature extraction on the feature to be processed to obtain a second extracted feature. Determining the candidate region may include: performing instance detection on the second extracted feature to obtain an instance-based candidate region in the image to be processed; extracting the regional features of the candidate region may include: performing target pooling processing on the features within the candidate region in the second extracted feature to obtain the regional features of the candidate region.

[0138] It should be noted that there can be one or more instance-based candidate regions in the image to be processed. If there are multiple candidate regions, each candidate region is processed independently to obtain the prediction result for the target task within the scope of each candidate region, and the prediction result for the target task of the image to be processed is obtained by combining the prediction results within the scope of each candidate region.

[0139] In a specific application scenario, a feature extractor is used to extract features from the features to be processed to obtain second extracted features. The second extracted features can be used to input the region proposal network (RPN) to obtain candidate regions. The second extracted features and the candidate regions are used to perform RoI Align (region of interest alignment) processing to obtain regional features. The regional features are then straightened into a series of one-dimensional features to obtain the features to be processed.

[0140] See also Figure 5 , Figure 5 It is a schematic diagram of another embodiment of the image processing method of the present application.

[0141] In this embodiment, the prediction result of the image to be processed for the target task is obtained by using an image processing model. Figure 5(a) shows the structure of the image processing model. The image processing model includes a feature extractor, a point decoder, and a point regression head.

[0142] Among them, the feature extractor includes a backbone network, a region proposal module, an object pooling module and a point encoder.

[0143] It should be noted that the backbone network is used to extract features from the input image to be processed and the first sample image.

[0144] In a specific application scenario, a ResNet-101 backbone network pre-trained on the ImageNet database is used as a feature extractor. The backbone is shared by the first sample image (support image) and the image to be processed (query image).

[0145] In a specific application scenario, a region proposal network (RPN) is used as a region proposal module to obtain candidate regions.

[0146] In a specific application scenario, the target pooling module may be a region of interest alignment (RoI Align) module, which is used to extract regional features of the candidate region.

[0147] In some embodiments, before performing dimensional transformation on the regional features, the position code and the regional features may be fused, and then the dimensional transformation may be performed.

[0148] In a specific application scenario, the point encoder is used to process the first extracted feature of the first sample image to obtain the first sample feature.

[0149] Among them, the point decoder includes L decoder layers, each decoder layer includes a self-attention component and a cross-attention component. The point features output by the point encoder are used to input the self-attention component of the first layer as key features, value features, and query features. For the self-attention components of the non-first layer, the output of the cross-attention of the previous layer is used to input the self-attention components of the next layer as key features, value features, and query features. The output of each layer of self-attention components is used to input the cross-attention components of this layer as query features. The features output by the target pooling module are straightened to obtain the features of the region of interest, which are used as the key features and value features of the cross-attention components of each layer.

[0150] It should be noted that the decoder layer can also include a feed-forward network (FFN) and layer normalization (LN). Finally, this process obtains enhanced point features for input into the point regression head.

[0151] The point regression head is used to regress the enhanced point features. Specifically, a multi-layer perceptron (MLP) is used to convert them into point coordinates. Instead of directly predicting the absolute coordinates, we predict the offset from the center of the anchor point, and finally, add the offset prediction to the anchor point bounding box.

[0152] Figure 5 (b) shows the original label of the first sample image under multiple preset tasks and the label represented by key points (dynamic point representation), where the multiple preset tasks include instance detection, instance segmentation, instance counting and pose estimation. And the result of processing the image to be processed under the guidance of the first sample image is also given.

[0153] It should be noted that the above preset tasks are only examples, and other preset tasks may be set as needed, and the preset tasks may also be represented in the form of key points.

[0154] See also Figure 6 , Figure 6 1 is a flow chart of another embodiment of the image processing method of the present application. Specifically, the prediction result of the image to be processed for the target task is obtained by using the image processing model, and the method may also include the following steps to train the image processing model:

[0155] Step S610: Obtain sample image pairs corresponding to at least one sample task.

[0156] It should be noted that the image processing model is a general model applicable to multiple preset tasks. During the training process of the image processing model, the task used for training is at least one sample task.

[0157] Wherein, at least one sample task includes at least one of a plurality of preset tasks. The preset task is a processing task that can be applied after the model training is completed. The tasks involved in the training process can be used as tasks applicable to the model.

[0158] Of course, there may be some cases where the sample tasks include other tasks besides the preset tasks, that is, some sample tasks used for training may not be tasks applicable to the model. For example, the sample tasks involved in the model training process are instance detection, instance segmentation, and pose estimation. After the training is completed, the preset tasks applicable to the model are instance detection and instance segmentation.

[0159] In some embodiments, at least one of the multiple preset tasks is not a sample task. In other words, the processing tasks that can be supported after the model training is completed may include tasks that are not involved in the model training process.

[0160] For example, the sample tasks involved in the model training process are instance detection, instance segmentation, and pose estimation. After the training is completed, the preset tasks applicable to the model are instance detection, instance segmentation, pose estimation, and instance counting. Among them, all the preset tasks uniformly use key points to represent instances.

[0161] The model can learn common knowledge for different tasks during the training process. Therefore, even if some tasks do not appear during training, the model can still handle the task.

[0162] Each sample task corresponds to data for training, namely, a sample image pair. The sample image pair includes a second sample image and a third sample image, and the second sample image and the third sample image are respectively annotated with a second label and a third label of the corresponding sample task.

[0163] In each sample image pair, the second sample image is used as the image to be processed, and the third sample image is used to provide features related to the sample task.

[0164] Step S620: For each sample task, extract the second sample feature related to the sample task from the third sample image.

[0165] Among them, each sample task is processed separately.

[0166] In a specific application scenario, each batch of training data is randomly extracted from the training data of all sample tasks. The training data extracted at one time may correspond to one or more sample tasks. The image processing model is used to process the training data corresponding to each sample task in turn.

[0167] Step S620 and step S630 may be implemented using an image processing model. For details, reference may be made to the relevant contents in the aforementioned embodiments, which will not be elaborated here.

[0168] Step S630: Based on the second sample feature and the second sample image, obtain a sample prediction result of the second sample image for the sample task.

[0169] Step S640: Based on the difference between the sample prediction result and the second label, the target loss of the sample task is obtained.

[0170] The second sample image is annotated with a second label of the corresponding sample task, that is, the true value of the sample task, and the sample prediction result is the predicted value of the sample task corresponding to the second sample image. Based on the difference between the predicted value and the true value, the target loss of the sample task can be obtained.

[0171] Step S650: Use the target loss of each sample task to adjust the parameters of the image processing model.

[0172] The object of parameter adjustment may be the parameters of the entire image processing model.

[0173] In some embodiments, a sample task may correspond to multiple sample image pairs, a sample image pair may determine a sample prediction result and a corresponding second label, and the target loss corresponding to the sample task may be obtained based on the difference between the above sample prediction result and the corresponding second label.

[0174] See also Figure 7 , Figure 7 This application Figure 6 Schematic diagram of another embodiment of step S640 in FIG. 1 . Specifically, this step may include:

[0175] Step S741: Based on the difference between the predicted value of the key point about the neighborhood structure characterization information in the sample prediction result and the true value of the corresponding key point about the neighborhood structure characterization information in the second label, the loss parameter corresponding to the key point is obtained.

[0176] The sample task is represented in the form of key points associated with an instance, and there are multiple key points associated with an instance.

[0177] Among them, the neighborhood structure representation information can represent the structural information of a key point within its neighborhood.

[0178] Step S742: Count the loss parameters corresponding to each key point in the sample prediction result to obtain the target loss of the sample task.

[0179] The sample prediction result contains multiple key points. The loss parameter is determined for each key point, and then the loss parameters of all key points are statistically analyzed to obtain the target loss of the sample prediction result for the sample task.

[0180] It is understandable that the prediction result and the corresponding label contain the same number of key points, and there is a one-to-one correspondence between the two. The prediction result and the corresponding label actually contain the location information of the key points, such as coordinates.

[0181] Specifically, the key points in the sample prediction result are the second predicted key points, the key points in the second label are the second real key points, the number of the second predicted key points and the second real key points is the same, and the second predicted key points and the second real key points are in a one-to-one correspondence.

[0182] For a certain key point A1 in the sample prediction result, the predicted value of the key point A1 about the neighborhood structure characterization information can be obtained based on the sample prediction result. There is a corresponding key point A2 in the second label. Based on the second label, the true value of the corresponding key point A2 about the neighborhood structure characterization information can be obtained. The difference between the two can be used to obtain the loss parameter of the key point A1.

[0183] The predicted value of the neighborhood structure representation information is obtained based on the neighborhood information of the key point A1 in the sample prediction result, and the true value of the neighborhood structure representation information is obtained based on the neighborhood information of the corresponding key point A2 in the second label.

[0184] See also Figure 8 , Figure 8 It is a schematic diagram of another embodiment of the image processing method of the present application.

[0185] like Figure 8 As shown in (a), the predicted points on the diamond shape will result in the same L1 loss, while the points on the circle will result in the same L2 loss. This introduces ambiguity in the learning process of the model. The neighborhood structure representation information of the key point is introduced in this application, which can characterize the structural information of the key point in the neighborhood, thereby alleviating the aforementioned ambiguity.

[0186] In some embodiments, a key point corresponds to a fifth preset number of neighboring point pairs, the neighboring point pair and the key point are associated with the same instance, and the neighboring point pair includes two neighboring points, and the neighboring point and the key point are separated by a sixth preset number of points. Different neighboring point pairs correspond to different sixth preset numbers.

[0187] In some embodiments, there may be one or more instances in the image. A fifth preset number of neighborhood point pairs may be set for each key point, the neighborhood point pair including two neighborhood points associated with the key point and the same instance, and the neighborhood structure characterization information of the key point is the structural constraint information within an instance. One of the two neighborhood points is before the key point, and the other is after the key point, and the two neighborhood points are separated from the key point by a sixth preset number of points.

[0188] In a specific application scenario, a key point can be set with N neighboring point pairs. A neighboring point pair contains two neighboring points, which are n-hop points adjacent to the key point. Different neighboring point pairs correspond to different n values. For the i-th point, the i+n-th point and the in-th point are its neighboring point pair.

[0189] In a specific application scenario, the sixth preset number of values ​​corresponding to all neighborhood point pairs may be taken sequentially starting from 0 until a fifth preset number of values ​​is taken.

[0190] In a specific application scenario, N can take a value of 2, the sixth preset number corresponding to the first pair of neighborhood point pairs is 0, that is, the i+1th point and the i-1th point are used as a neighborhood point pair, and the sixth preset number corresponding to the second pair of neighborhood point pairs is 1, that is, the i+2th point and the i-2th point are used as a neighborhood point pair.

[0191] The neighborhood point pair of the second predicted key point is the predicted neighborhood point pair, and the neighborhood point pair of the second real key point is the real neighborhood point pair. The target angle formed between the second predicted key point and each predicted neighborhood point pair is preset to obtain the predicted value corresponding to each predicted neighborhood point pair, and the target angle formed between the second real key point and each real neighborhood point pair is preset to obtain the real value corresponding to each real neighborhood point pair. The difference between the predicted value and the real value corresponding to each neighborhood point group is obtained, and the central tendency statistical value of the difference corresponding to each neighborhood point pair group is used as the loss parameter of the second predicted key point.

[0192] Each group of neighborhood points corresponds to a predicted neighborhood point pair and a real neighborhood point pair.

[0193] In a specific application scenario, the target angle is preset to obtain the neighborhood structure characterization information corresponding to the neighborhood point pair. Specifically, the target angle formed between the second predicted key point and the predicted neighborhood point pair is preset to obtain the predicted value of the neighborhood structure characterization information corresponding to the predicted neighborhood point pair, and the same is true for each predicted neighborhood point pair. The target angle formed between the second real key point and the real neighborhood point pair is preset to obtain the real value of the neighborhood structure characterization information corresponding to the real neighborhood point pair, and the same is true for each real neighborhood point pair. For a predicted neighborhood point pair and a real neighborhood point pair (a group of neighborhood point groups) that have a corresponding relationship, the loss parameter is determined by the difference between the predicted value and the real value of the neighborhood structure characterization information. The differences of each neighborhood point group are statistically analyzed to obtain the central tendency statistic as the loss parameter of the second prediction key point.

[0194] In some embodiments, the preset processing of the target angle includes using the angle value of the target angle as the neighborhood structure representation information corresponding to the neighborhood point pair. The predicted value is obtained based on the second predicted key point, and the real value is obtained based on the second real key point.

[0195] In some embodiments, the gradient of the loss parameter obtained after the preset processing decreases as the angle value of the target angle increases.

[0196] See also Figure 8In (b), the i-th point in the figure forms an angle of 59 degrees with the i+1-th point and the i-1-th point. The j-th point in the figure forms an angle of 164 degrees with the j+2-th point and the j-2-th point. After the preset processing, the gradient of the loss parameter obtained after the preset processing decreases as the angle value of the target angle increases, that is, the gradient at the peak is amplified and the gradient in the flat area is weakened, so that the model can pay more attention to the peak area to capture detailed shape information.

[0197] In some embodiments, there are two angles formed by the key point and the neighboring point pair, a total of three points, and the angle between 0 degrees and 180 degrees is selected as the target angle.

[0198] In a specific application scenario, the target angle is preset to obtain neighborhood structure characterization information by using the sine value of the target angle as the neighborhood structure characterization information corresponding to the neighborhood point pair, and the target angle is half of the angle value of the target angle.

[0199] In a specific application scenario, the loss of the i-th point can be determined by the following formula:

[0200]

[0201] Among them, P i represents the i-th second predicted key point, Indicates the second real key point corresponding to the i-th second predicted key point. There are N pairs of neighboring points, n means that the neighboring point pair is n jump points. θ i ( n ) represents the angle between the i-th second predicted key point and its n-th jump point, It represents the angle between the second real key point corresponding to the i-th second predicted key point and its n-hop point.

[0202] In some embodiments, the loss parameters of the second predicted key point may include position loss parameters in addition to the above-mentioned structural loss parameters. Specifically, the coordinate loss parameters may be obtained based on the difference between the predicted position of the second predicted key point and the actual position of the corresponding second real key point.

[0203] In a specific application scenario, the loss of the i-th point can be determined by the following formula:

[0204]

[0205] In some embodiments, the image processing model is trained based on a few-sample learning technique. Further, a two-stage transfer learning method can be used for training. In the first stage, sample images containing instances of the base category are used to jointly train the model for at least one sample task and adjust the model parameters. In the first stage, the training steps and the loss function used can refer to the above content. In the second stage, sample images containing instances of the new category are used to fine-tune the classification head in the model.

[0206] The number of sample images of each new category instance is less than the number of images of the base category instance. For example, the number of sample images of each new category instance may be less than 100, and the number of images of the base category instance may be more than 500.

[0207] In a specific application scenario, the number of sample images of a new category instance may be 1 or 2.

[0208] See also Fig. 9 , Fig. 9 It is a schematic diagram of the framework of an embodiment of the image processing device of the present application.

[0209] In this embodiment, the image processing device 90 includes an acquisition module 91, an extraction module 92 and a prediction module 93. The acquisition module 91 is used to acquire a first sample image; the extraction module 92 is used to extract a first sample feature about a target task from the first sample image, where the target task is any one of a plurality of preset tasks, and the preset task is a perception task for an instance; the prediction module 93 is used to obtain a prediction result of the image to be processed for the target task based on the first sample feature and the feature to be processed of the image to be processed.

[0210] See also Fig.10 , Fig.10 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application.

[0211] In this embodiment, the electronic device 100 includes a memory 101 and a processor 102, and the processor 102 is used to execute the program instructions stored in the memory 101 to implement the steps in any of the above-mentioned image processing method embodiments. In a specific implementation scenario, the electronic device 100 may include but is not limited to: computer equipment, power equipment, microcomputers, desktop computers, servers, and in addition, the electronic device 100 may also include mobile devices such as laptops and tablet computers, which are not limited here.

[0212] Specifically, the processor 102 is used to control itself and the memory 101 to implement the steps in any of the above-mentioned image processing method embodiments. The processor 102 can also be called a CPU (Central Processing Unit). The processor 102 may be an integrated circuit chip with signal processing capabilities. The processor 102 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 102 can be implemented by an integrated circuit chip.

[0213] See also Fig.11 , Fig.11 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application.

[0214] In this embodiment, the computer-readable storage medium 110 stores program instructions 111 that can be executed by a processor. When the program instructions 111 are executed by the processor, they are used to implement the steps in any of the above-mentioned image processing method embodiments.

[0215] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0216] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as units or components can be combined or integrated into another subsystem, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0217] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

Claims

1. An image processing method, It is characterized in that The method comprises: Acquire a first sample image; Extracting a first sample feature related to a target task from the first sample image, where the target task is any one of a plurality of preset tasks, and the preset task is an instance-aware task; Based on the first sample features and the features to be processed of the image to be processed, a prediction result of the image to be processed for the target task is obtained.

2. The method according to claim 1, It is characterized in that The obtaining, based on the first sample feature and the feature to be processed of the image to be processed, a prediction result of the image to be processed for the target task comprises: The first sample feature and the feature to be processed are sequentially subjected to at least one decoding process, wherein the input feature of each decoding process includes the original task feature and the feature to be processed, the original task feature of the first decoding process is the first sample feature, and the original task feature of the non-first decoding process is the output feature obtained by the previous decoding process; Based on the output features of the last decoding process, a prediction result of the image to be processed with respect to the target task is obtained.

3. The method according to claim 2, It is characterized in that Each decoding process includes: Based on the original task features of this decoding process, obtaining the updated task features corresponding to the target task in this decoding process, fusing the updated task features with the features to be processed, and obtaining the output features of this decoding process; Alternatively, the original task features and the features to be processed are fused to obtain output features of this decoding process.

4. The method according to claim 3, It is characterized in that The obtaining of the updated task features corresponding to the target task in the current decoding process based on the original task features of the current decoding process includes: Performing feature enhancement on the target task on the original task feature to obtain the updated task feature; And / or, the original task feature or the updated task feature is used as the task feature, and the task feature and the feature to be processed are fused to obtain the output feature of this decoding process, including: The features to be processed are respectively used as key features and value features, and the task features are used as query features. Cross-attention processing is performed using the key features, the value features, and the query features to obtain the output features.

5. The method according to any one of claims 1 to 4, It is characterized in that The first sample image is annotated with a first label corresponding to the target task, and the first label includes a plurality of first real key points associated with the instance; Extracting a first sample feature related to a target task from the first sample image includes: Performing feature extraction on the first sample image to obtain extracted features; Extracting point features corresponding to each of the first real key points from the extracted features according to the first label; The first sample features are obtained based on the point features corresponding to the first real key points.

6. The method according to claim 5, It is characterized in that The step of extracting point features corresponding to each of the first real key points from the extracted features according to the first label includes: Fusing the extracted features with the position code to obtain a fusion result; performing bilinear interpolation on the fusion result according to the position information of each of the first real key points to obtain point features corresponding to each of the first real key points; and / or, The obtaining the first sample feature based on the point features corresponding to each of the first real key points includes: In response to the presence of an instance in the first sample image, taking point features corresponding to each of the first real key points as the first sample features; In response to the presence of multiple instances in the first sample image, all point features corresponding to each key point group are counted respectively to obtain statistical features corresponding to each key point group as the first sample feature, each group of the key point groups contains a first real key point associated with each instance, and there is a corresponding relationship between all the first real key points in the same key point group.

7. The method according to any one of claims 1 to 6, It is characterized in that Before obtaining a prediction result of the image to be processed for the target task based on the first sample feature and the feature to be processed of the image to be processed, the method further includes: Determining an instance-based candidate region in the image to be processed; Extracting regional features of the candidate region; Performing dimension transformation on the region features of the candidate region to obtain at least one one-dimensional feature as the feature to be processed.

8. The method according to any one of claims 1 to 7, It is characterized in that The multiple preset tasks include one or more of instance detection, instance segmentation, posture estimation, and instance counting; the preset tasks are represented in the form of key points associated with instances; The key points corresponding to the instance detection are the boundary points of the instance detection box; The key points corresponding to the instance segmentation are the boundary points of the instance mask; The key points corresponding to the posture estimation are the semantic key points of the instance; The key point corresponding to the instance count is the identification point of the instance.

9. The method according to any one of claims 1 to 8, It is characterized in that The prediction result of the target task is obtained by using an image processing model, and the method further includes the following steps to train the image processing model: Acquire a pair of sample images corresponding to at least one sample task, the pair of sample images comprising a second sample image and a third sample image, the second sample image and the third sample image are respectively annotated with a second label and a third label of the corresponding sample task; the at least one sample task comprises at least one of the plurality of preset tasks; For each of the sample tasks, using the image processing model, extracting a second sample feature related to the sample task from the third sample image; based on the second sample feature and the second sample image, obtaining a sample prediction result of the second sample image for the sample task; Obtaining a target loss for the sample task based on a difference between the sample prediction result and the second label; The target loss of each of the sample tasks is used to adjust the parameters of the image processing model.

10. The method according to claim 9, It is characterized in that The sample task is represented in the form of key points associated with an instance, and the number of key points associated with one instance is multiple, and the target loss of the sample task is obtained based on the difference between the sample prediction result and the second label, including: Obtaining a loss parameter corresponding to the key point based on a difference between a predicted value of the key point in the sample prediction result with respect to the neighborhood structure representation information and a true value of the key point corresponding to the second label with respect to the neighborhood structure representation information; The loss parameters corresponding to each of the key points in the sample prediction results are counted to obtain the target loss of the sample task.

11. The method according to claim 10, It is characterized in that One of the key points corresponds to a fifth preset number of neighborhood point pairs, the neighborhood point pair includes two neighborhood points associated with the same instance as the key point, and the neighborhood point is separated from the key point by a sixth preset number of points, and different neighborhood point pairs correspond to different sixth preset numbers; the key point in the sample prediction result is a predicted key point, the neighborhood point pair of the predicted key point is a predicted neighborhood point pair, the key point in the second label is a second real key point, and the neighborhood point pair of the second real key point is a real neighborhood point pair; The difference between the predicted value of the key point in the sample prediction result with respect to the neighborhood structure characterization information and the true value of the corresponding key point in the second label with respect to the neighborhood structure characterization information, obtaining the loss parameter corresponding to the key point includes: Presetting the target angles formed between the prediction key points and each of the prediction neighborhood point pairs to obtain the prediction values ​​corresponding to each of the prediction neighborhood point pairs; and Preset processing is performed on the target angle formed by the second real key point and each real neighborhood point pair respectively to obtain the real value corresponding to each real neighborhood point pair; The difference between the predicted value and the true value corresponding to each group of neighborhood point groups is obtained, and the central tendency statistical value of the difference corresponding to each group of neighborhood point groups is used as the loss parameter of the prediction key point, and each group of the neighborhood point groups includes a corresponding predicted neighborhood point pair and a true neighborhood point pair.

12. The method according to claim 11, It is characterized in that The preset processing includes using the angle value of the target angle as the neighborhood structure characterization information corresponding to the neighborhood point pair; or, the gradient of the loss parameter obtained after the preset processing decreases as the angle value of the target angle increases.

13. An image processing device, It is characterized in that include: An acquisition module, used for acquiring a first sample image; An extraction module, configured to extract a first sample feature related to a target task from the first sample image, wherein the target task is any one of a plurality of preset tasks, and the preset task is an instance-aware task; A prediction module is used to obtain a prediction result of the image to be processed for the target task based on the first sample feature and the feature to be processed of the image to be processed.

14. An electronic device, It is characterized in that The method comprises a memory and a processor, wherein the memory stores program instructions, and when the program instructions are executed by the processor, the method according to any one of claims 1 to 12 is implemented.

15. A computer-readable storage medium having program instructions stored thereon, It is characterized in that When the program instructions are executed by a processor, the method according to any one of claims 1 to 12 is implemented.

Citation Information

Patent Citations

  • Image processing method and device

    CN111292331A

  • Image processing method and device, equipment and storage medium

    CN114863257A

  • Image processing method and device, vehicle, storage medium and chip

    CN115035494A

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

    CN117496327A

  • Data processing method and apparatus, and device and computer medium

    WO2023241410A1

Cited By

  • Evaluation method and device and electronic equipment

    CN119807040A