Object recognition method and system
By directly predicting the vertex coordinates of building polygons using the Transformer structure and combining it with a corner classification head, the polygon detection process is simplified, the problem of error superposition in existing technologies is solved, and the accuracy and efficiency of object recognition are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ALIBABA (CHINA) CO LTD
- Filing Date
- 2023-02-02
- Publication Date
- 2026-06-09
AI Technical Summary
In existing technologies, identifying objects in an image by first segmenting the region and then analyzing the contour is prone to error accumulation, leading to inaccurate analysis results.
The Transformer structure is used to directly predict the vertex coordinates of building polygons. Combined with a corner classification head to remove redundant vertices, it is simplified into an end-to-end polygon detection model, PolyBuilding, to avoid error overlap.
It improves the accuracy of target object recognition in images, simplifies the process, increases efficiency, and can effectively deal with occlusion situations.
Smart Images

Figure CN116109837B_ABST
Abstract
Description
Technical Field
[0001] The embodiments in this specification relate to the field of computer technology, and in particular to object recognition methods. Background Technology
[0002] With the continuous development of computer technology, users have increasingly higher demands for the accuracy of image recognition.
[0003] To identify objects in an image, such as buildings or lawns, we can first segment the area where the object is located and draw a bounding box; then we can further analyze the outline of the object within the segmented bounding box.
[0004] However, the method of first segmenting the region and then analyzing the contour in the segmented region is prone to the accumulation of errors, resulting in inaccurate analysis results. Therefore, there is an urgent need for a method that can more accurately obtain the bounding box and contour of the target object in the image. Summary of the Invention
[0005] In view of this, embodiments of this specification provide an object recognition method. One or more embodiments of this specification also relate to an object recognition device, an object recognition system, a computing device, a computer-readable storage medium, and a computer program, to address the technical deficiencies existing in the prior art.
[0006] According to a first aspect of the embodiments of this specification, an object identification method is provided, comprising:
[0007] In response to an object recognition request, a target object is identified from the image to be processed, and an identification box containing the target object is drawn, wherein the target object is an object of a preset type;
[0008] Predict the set of contour points corresponding to the target object;
[0009] Select at least three target contour points from the set of contour points, and generate a polygon corresponding to the target object based on the at least three target contour points.
[0010] According to a second aspect of the embodiments of this specification, an object recognition device is provided, comprising:
[0011] The recognition module is configured to, in response to an object recognition request, identify a target object from an image to be processed and draw an identification box containing the target object, wherein the target object is an object of a preset type;
[0012] The prediction module is configured to predict the set of contour points corresponding to the target object;
[0013] The filtering module is configured to filter at least three target contour points from the set of contour points, and generate a polygon corresponding to the target object based on the at least three target contour points.
[0014] According to a third aspect of the embodiments of this specification, another object recognition method is provided, including:
[0015] Receive an object recognition request and determine an image to be processed based on the object recognition request, wherein the image to be processed contains a target object;
[0016] The image to be processed is input into an object recognition model, wherein the object recognition model includes a feature extraction module, an encoding module, and a prediction module; the feature extraction module extracts image feature sequences from the image to be processed; the encoding module encodes the image feature sequences to obtain object feature vectors of target objects in the image to be processed; the prediction module predicts the bounding box and polygons of the target objects based on the object feature vectors.
[0017] Obtain the bounding box and polygon of the target object output by the object recognition model.
[0018] According to a fourth aspect of the embodiments of this specification, another object recognition device is provided, comprising:
[0019] The receiving module is configured to receive an object recognition request and determine an image to be processed based on the object recognition request, wherein the image to be processed contains a target object;
[0020] An input module is configured to input the image to be processed into an object recognition model, wherein the object recognition model includes a feature extraction module, an encoding module, and a prediction module; the feature extraction module extracts an image feature sequence from the image to be processed; the encoding module encodes the image feature sequence to obtain an object feature vector of a target object in the image to be processed; and the prediction module predicts the bounding box and polygon of the target object based on the object feature vector.
[0021] The acquisition module is configured to acquire the bounding box and polygon of the target object output by the object recognition model.
[0022] According to a fifth aspect of the embodiments of this specification, an object identification system is provided, including an edge testing device and a cloud testing device, wherein:
[0023] The end-to-end testing device is used to generate an object recognition request based on the image to be processed, and send the object recognition request to the cloud testing device;
[0024] The cloud testing device is configured to, in response to an object recognition request, identify a target object from an image to be processed and draw an identification box containing the target object, wherein the target object is an object of a preset type; predict a set of contour points corresponding to the target object; select at least three contour points from the set of contour points and generate a polygon corresponding to the target object based on the at least three contour points;
[0025] The end-measuring device is also used to display the image to be processed, which includes the identification frame and the polygon.
[0026] According to a sixth aspect of the embodiments of this specification, a computing device is provided, comprising:
[0027] Memory and processor;
[0028] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the object recognition method described above.
[0029] According to a seventh aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores computer-executable instructions that, when executed by a processor, implement the steps of the object recognition method described above.
[0030] According to an eighth aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the object recognition method described above.
[0031] One embodiment of this specification implements, in response to an object recognition request, identifying a target object from an image to be processed and drawing an identification box containing the target object, wherein the target object is an object of a preset type; predicting a set of contour points corresponding to the target object; selecting at least three target contour points from the set of contour points; and generating a polygon corresponding to the target object based on the at least three target contour points.
[0032] By simultaneously identifying the bounding box and polygon of the target object in the image to be processed, the problem of overlapping errors caused by identifying the polygon of the target object within the bounding box after determining the bounding box is avoided, thus improving the image recognition accuracy of the target object. Attached Figure Description
[0033] Figure 1 This is a schematic diagram of a scenario illustrating an object recognition method provided in one embodiment of this specification;
[0034] Figure 2 This is a flowchart of an object recognition method provided in one embodiment of this specification;
[0035] Figure 3 This is a flowchart of another object recognition method provided in one embodiment of this specification;
[0036] Figure 4 This is a schematic diagram of an encoding method provided in one embodiment of this specification;
[0037] Figure 5 This is a schematic diagram of the structure of an object recognition system provided in one embodiment of this specification;
[0038] Figure 6 This is a schematic diagram of the structure of an object recognition device provided in one embodiment of this specification;
[0039] Figure 7 This is a schematic diagram of another object recognition device provided in one embodiment of this specification;
[0040] Figure 8 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation
[0041] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0042] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification 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, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."
[0044] First, the terms and concepts used in one or more embodiments of this specification will be explained.
[0045] Transformer: A deep learning model that employs a self-attention mechanism.
[0046] Positional encoding is a method that uses the positional information of words to represent each word in a sequence, allowing the input data to carry positional information so that the model can identify positional features.
[0047] Multi-scale features: Sampling features at different granularities in the image.
[0048] Vision Transformer (hereinafter referred to as ViT) applies the ideas from the field of NLP to the field of CV. Specifically, ViT divides the original image into several patches evenly. Each small patch can be regarded as a word in NLP. The patches are flattened into a sequence, and then the segmented patches are input into the encoder part of the original Transformer model. Finally, the image is classified through a normal fully connected layer.
[0049] ResNet, also known as a residual neural network, refers to the addition of residual learning to traditional convolutional neural networks. It solves the problems of gradient vanishing and accuracy degradation (training set) in deep networks, allowing the network to become increasingly deeper while maintaining accuracy and controlling speed.
[0050] NMS (non-maximum suppression) is, as the name suggests, a suppression of elements that are not maximum values; it can be understood as a local maximum search.
[0051] IoU (Intersection over Union): A pixel-level evaluation metric that assesses the accuracy of building predictions at the pixel level.
[0052] Buildings, as man-made structures, have regular shapes; for example, corners are usually orthogonal, and exterior walls are typically straight lines. Most previous building extraction methods used segmentation to obtain pixel-level segmentation results. While this raster-based output has a high IoU (Intersection over Union) index, its contours are often highly irregular, with rounded corners and non-straight edges. Some methods first regularize this segmentation result and then vectorize it into polygons to obtain vectorized building results. However, this two-stage approach is complex, inefficient, and prone to error accumulation. Another type of method directly predicts building polygons. PolyMapper is a relatively good method in this category, but it still has some problems, such as a high false negative rate and difficulty in handling vegetation occlusion. PolyMapper uses a two-stage approach: first, it uses an object detector (Faster R-CNN) to predict building bounding boxes; then, within the bounding boxes, an RNN model sequentially predicts the corners of the building. This CNN-RNN scheme is complex, difficult to train, time-consuming inference, and has limited effectiveness. The Curve-GCN vector building method is also a two-stage approach. It first performs object detection, and then uses a GCN network to predict building corner points within the bounding boxes in a single step. This CNN-GCN scheme is also complex and difficult to train, and the predicted polygons have the same number of vertices, resulting in significant vertex redundancy. PolyWork first predicts the segmentation results of all building vertices, extracts vertex coordinates from them, and then predicts a connectivity matrix indicating whether vertices are connected. The problem with this approach is that it generates a large number of missed detections because the vertices are extracted from the segmentation results. If there is occlusion such as vegetation, the vertices cannot be correctly extracted, leading to missed detections.
[0053] Vector building extraction is essentially polygon detection, and object detection and polygon detection share some similarities. Both require instance-level detection to extract each building individually. However, object detection only needs to predict a bounding box containing the instance, while polygon detection requires predicting the vertex coordinates of polygons along the instance's contour. Based on this, we extend the Deformable DETR object detection framework to predict polygons simultaneously with bounding boxes, resulting in our vector object detection model, PolyBuilding. Deformable DETR is a fully end-to-end object detection model, abandoning the anchor settings and non-maximum suppression (NMS) operations found in previous two-stage object detectors like Faster R-CNN, making the entire model more concise and efficient. PolyBuilding inherits the advantages of Deformable DETR and can directly predict polygon vertex coordinates.
[0054] This specification provides an object recognition method, and also relates to an object recognition device, an object recognition system, a computing device, and a computer-readable storage medium, which will be described in detail in the following embodiments.
[0055] See Figure 1 , Figure 1 This is a schematic diagram illustrating a scenario of an object recognition method provided in one embodiment of this specification, specifically including:
[0056] In response to an object recognition request, the server identifies the image to be processed as a remote sensing image. Multi-scale feature extraction is then performed on the remote sensing image. This extraction can employ convolutional neural networks such as ResNet or Transformer structures such as Vit, resulting in multi-scale features with a smaller size than the input remote sensing image. The obtained multi-scale features are then positionally encoded (i.e., added to the positional encoding in the image) and expanded into an image feature sequence before being input into the Transformer encoder.
[0057] The Transformer architecture consists of an encoder and a decoder. The encoder comprises six identical layers, each consisting of a multi-scale deformable self-attention layer and a feed-forward layer. The encoder receives a sequence of image features and uses the multi-scale deformable self-attention layer to encode the long-range feature association information. The encoder output is a new multi-scale feature containing the feature association information, i.e., the target multi-scale feature.
[0058] The decoder consists of six identical layers, each comprising a self-attention layer, a multi-scale deformable cross-attention layer, and a feed-forward layer. The decoder takes N randomly initialized polygon prediction data points (i.e., image prediction data) as input, corresponding to the N building polygons to be predicted. The other input is multi-scale features from the encoder. First, the self-attention layer encodes the relationships between the polygons, and then the cross-attention layer encodes the multi-scale feature information into the image prediction data. The decoder outputs the encoded N polygon features.
[0059] Finally, the N polygon features are input into the prediction head. Among the four prediction heads, the object classification module is used to determine the category of the N buildings (i.e., whether the object is a building); the target box module is used to identify the target boxes of the buildings; the polygon prediction module is used to predict the coordinates of the building polygons; and the corner classification module is used to determine whether each contour point is a corner point.
[0060] The target contour points in the contour point set are filtered based on the processing results of the prediction head output, i.e., redundant contour points in the data are filtered out; the redundant contour points are further filtered based on the NMS (non-maximum suppression) operation to determine the final polygon contour points; and a polygon consistent with the contour is drawn on the remote sensing image based on the polygon contour points.
[0061] One embodiment of this specification implements a method that directly predicts the vertex coordinates of building polygons using a Transformer structure, which is simpler and more efficient than the two-stage method of first predicting the target bounding box and then predicting the building corner points. The corner point classification head can effectively remove a large number of redundant vertices, ensuring the regularity and simplicity of the predicted polygons. In addition, the solution in this specification can effectively deal with occlusion situations because by directly predicting the contour point coordinates, the position of the occluded contour point can be effectively inferred from the position of the unoccluded contour point.
[0062] See Figure 2 , Figure 2 This is a flowchart of an object recognition method provided in one embodiment of this specification, which specifically includes the following steps.
[0063] Step 202: In response to the object recognition request, identify the target object from the image to be processed and draw an identification box containing the target object, wherein the target object is an object of a preset type.
[0064] Here, "object recognition request" refers to a request to identify a target object in an image to be processed; "image to be processed" refers to an image containing the target object, and the outline of the target object in the image to be processed is a polygon, such as a map containing buildings, a photo containing cars, etc.; "target object" refers to an object contained in the image to be processed, such as a building, a car, a bridge, etc. in a map image; "marker box" refers to a rectangular box that can mark the location of the target object in the image to be processed, and the marker box contains at least three or more outline points; in practical applications, the marker box can divide the image to be processed into a rectangular or polygonal box that is larger than or equal to the area where the target object is located; "preset type" refers to a pre-set object type, such as a building type, vegetation type, etc.
[0065] Specifically, an object recognition request can be received by a terminal capable of executing the method described in this specification, wherein the terminal can be a client, a server, etc.; in response to the received object recognition request, an image to be processed is determined; a target object is identified in the image to be processed determined based on the object recognition request; in practical applications, the image to be processed may contain one, two, or more objects, and any preset type of object can be determined as the target object; based on the determined target object, the region where the target object is located in the image to be processed is determined, and an identification box is drawn in that region.
[0066] In one specific embodiment of this specification, the server receives an object recognition request; in response to the object recognition request, it determines that the image to be processed is a map image; it identifies target objects in the map image, that is, it identifies each object in the map image, including building objects, road objects, and car objects, etc.; it selects objects of the building type, that is, it filters building objects as target images corresponding to map polygons; and it draws an identification box for each building object according to the area of the target image in the map image.
[0067] By identifying target objects in the image to be processed, a bounding box can be drawn based on the target objects, which facilitates the subsequent acquisition of the outline of the target objects in the image to be processed after the bounding box has been determined.
[0068] After determining the image to be processed, it is necessary to identify the target objects contained in the image; specifically, methods for identifying target objects from the image to be processed may include:
[0069] Collect multi-scale image features of the image to be processed;
[0070] The image multi-scale features are positionally encoded to obtain the image feature sequence corresponding to the image to be processed.
[0071] The target object is identified based on the image feature sequence.
[0072] In practical applications, image recognition can be achieved by encoding the image to be processed and then using the encoded image data. Multi-scale image features refer to image features extracted from the image to be processed based on different preset sizes. For example, feature maps of sizes 1 / 8, 1 / 16, and 1 / 32 can be extracted from a 320*320 image to be processed as multi-scale features. Positional encoding refers to encoding each multi-scale feature based on the image's positional information. The image feature sequence refers to the sequence obtained by expanding the positionally encoded target object data.
[0073] Specifically, multi-scale features of the image to be processed can be collected based on a pre-trained feature extraction network. The feature extraction model can be a Vision Transformer model, a ResNet convolutional neural network, etc. By collecting multi-scale features of the image to be processed, multi-scale features smaller than the size of the input polygon to be processed can be obtained.
[0074] In one specific embodiment of this specification, after the server determines the image to be processed, it extracts the multi-scale features of the image to be processed based on the VisionTransformer model; the multi-scale features of the image are then positionally encoded and expanded to obtain the image feature sequence corresponding to the image to be processed.
[0075] By extracting multi-scale features from the image to be processed, multi-scale features of different sizes than the input image to be processed are obtained; the extracted multi-scale features are encoded so that the generated image feature sequence contains the positional relationships between image contents.
[0076] Furthermore, the method for identifying target objects based on the image feature sequence may include:
[0077] Determine the feature association information corresponding to the image feature sequence;
[0078] The image feature sequence is encoded according to the feature association information to obtain multi-scale features of the target image containing the feature association information;
[0079] The target image is encoded with multi-scale features based on image prediction data, and the target object is determined based on the object feature vector obtained by encoding.
[0080] Feature association information refers to the association information between pixels with large spatial distances in the feature map. Image feature sequences are encoded based on this feature association information to obtain multi-scale features of the target image that contain feature association information. Multi-scale features of the target image refer to multi-scale features containing feature association information. Image prediction data refers to data used to predict the multi-scale features corresponding to the target object within the multi-scale features of the target image. In practical applications, image prediction data consists of one or more randomly initialized data sets. If feature prediction is required for multiple objects, multiple image prediction data sets need to be set. The object feature vector refers to the feature vector corresponding to the target object in the image to be processed. It is important to note that the object feature vector at this stage is still a representation of the image to be processed, and does not specifically predict the target object in the image. Subsequent predictions based on the object feature vector are needed to actually determine the target object.
[0081] The image feature sequence is encoded by feature association information to obtain multi-scale features of the target image containing feature association information, thereby supplementing the correlation information between pixels in the image feature sequence; the multi-scale features of the target image are encoded based on image prediction data so that the image prediction data is encoded into the multi-scale features of the target image.
[0082] In practical applications, methods for drawing a bounding box containing the target object may include:
[0083] The object location information corresponding to the target object is determined based on the object feature vector;
[0084] Draw the identification box of the target object based on the object's location information.
[0085] The object location information refers to the location information of the target object in the image to be processed. Specifically, the object feature vector can be input into the bounding box prediction module to obtain the object location information output by the bounding box prediction module, that is, the position coordinates of the identified bounding box. The bounding box prediction module is trained on an image with bounding boxes set. The image with bounding boxes set can be obtained by manually identifying the object and then drawing the bounding boxes, or by using automated methods. This specification does not make specific limitations. The bounding box of the target object is drawn according to the position coordinates of the bounding box.
[0086] In addition to determining the bounding box, it is also necessary to classify the object type of the target object. Specifically, this includes: inputting the object feature vector into the object classification module and obtaining the classification information output by the object classification module; the determined classification information can be used to subsequently determine the object type of the identified target object.
[0087] In practical applications, the bounding box can only roughly select the area of the target object in the image to be processed, and cannot complete the selection according to the actual outline of the target object. Therefore, when setting the bounding box for the target object, it is necessary to predict the actual outline of the target object so as to make a more accurate judgment on the target object based on the actual outline.
[0088] Step 204: Predict the set of contour points corresponding to the target object.
[0089] Here, the contour point set refers to the set of contour points corresponding to the target object; a contour point is a vertex on the contour corresponding to the target object, and connecting the vertices can obtain the contour of the target object.
[0090] In practical applications, methods for predicting the set of contour points corresponding to the target object may include:
[0091] Determine the initial contour points and the number of initial contour points corresponding to the target object;
[0092] The target object is encoded based on a preset number of contour points and an initial number of contour points to obtain a set of contour points corresponding to the target object, wherein the number of contour points in the set of contour points is consistent with the preset number of contour points.
[0093] Here, initial contour points refer to the contour points of the target object determined based on the object feature vector; initial contour points refer to the total number of contour points of the target object determined based on the object feature vector; by inputting the object feature vector into the contour point prediction module, the contour point coordinate information output by the contour point prediction module is obtained, where the contour point coordinate information refers to the coordinate information of the predicted contour points in the image to be processed; the preset number of contour points refers to the number of contour points determined based on data processing requirements.
[0094] Specifically, the object feature vector is input into the contour point prediction module; the contour point coordinate information output by the contour point prediction module is obtained; initial contour points are determined based on the contour point coordinate information, and the total number of initial contour points is counted to obtain the initial contour point count; the initial contour point count is compared with the preset contour point count, and if the initial contour point count is less than the preset contour point count, the target object is encoded based on the preset contour point count, that is, the object feature vector is supplemented with contour points to obtain a contour point set; the number of contour points in the contour point set is consistent with the preset contour point count.
[0095] In practical applications, any of the following methods can be used to encode the object feature vector so that the number of contour points corresponding to the set of contour points determined based on the encoded object feature vector is consistent with the preset number of contour points.
[0096] The first encoding method is the data padding method, which does not require considering the outline of the target object, but only pads the number of outline points to make the number of outline points consistent with the preset number of outline points.
[0097] Specifically, the method for encoding the target object based on a preset number of contour points and the initial number of contour points to obtain the set of contour points corresponding to the target object may include:
[0098] Supplementary data points are set based on the preset number of contour points and the initial number of contour points, wherein the supplementary data points include supplementary data point markers;
[0099] Generate a set of contour points corresponding to the target object based on the initial contour points and the supplementary data points.
[0100] Among them, supplementary data points refer to points used to supplement the number of data bits in the initial contour points; supplementary data point markers refer to identifiers used to mark supplementary data points. A supplementary data point marker is set on each supplementary data point so that the supplementary data points can be deleted later to ensure the accuracy of the contour points.
[0101] Specifically, determine the preset number of contour points and the initial number of contour points; if the initial number of contour points is less than the preset number of contour points, calculate the difference between the initial number of contour points and the preset number of contour points; based on the initial number of contour points, add supplementary data points for the difference, that is, add data bits for the difference to the object feature vector; and use the set of contour points consisting of the initial contour points and the supplementary data points as the contour point set corresponding to the target object.
[0102] In a specific embodiment of this specification, the initial number of contour points of the building object is determined to be 4, and the preset number of contour points is 90; the difference between the initial number of contour points and the preset number of contour points is determined to be 86; then 86 supplementary data points are added to the object feature vector, and a contour point set is set for each supplementary data point; the 86 supplementary data points and the 4 initial contour points are used as the contour point set corresponding to the building object.
[0103] The second encoding method is uniform sampling, which involves determining the initial contour trajectory of the target object and then uniformly collecting contour points on the initial contour trajectory so that the number of contour points is consistent with the preset number of contour points.
[0104] Specifically, the method for encoding the target object based on a preset number of contour points and the initial number of contour points to obtain the set of contour points corresponding to the target object may include:
[0105] Determine the contour trajectory based on the initial contour points;
[0106] According to the preset number of contour points, sample contour points are collected on the contour trajectory;
[0107] Generate a set of contour points corresponding to the target object based on the initial contour points and the sampled contour points.
[0108] Here, the contour trajectory refers to the contour trajectory of the target object determined based on the initial contour points; the sampled contour points refer to the contour points obtained on the contour trajectory; the sampled contour points also have contour point identifiers so that they can be deleted later to ensure the accuracy of the contour points.
[0109] Specifically, the contour trajectory is determined based on the initial contour points; if the number of initial contour points is less than the preset number of contour points, the difference between the number of initial contour points and the preset number of contour points is determined; contour points are evenly set on the contour trajectory based on the difference, that is, sampled contour points of the difference number are collected on the contour trajectory; and a set of contour points corresponding to the target object is generated from the initial contour points and the sampled contour points.
[0110] In a specific embodiment of this application, the initial number of contour points of the vegetation object is determined to be 7, and the preset number of contour points is 40; the initial number of contour points is determined to be less than the preset number of contour points, and the difference between the initial number of contour points and the preset number of contour points is 33; the contour trajectory of the vegetation object is determined based on the initial contour points, and 33 sampling contour points are uniformly collected on the contour trajectory; the contour point set corresponding to the vegetation object is composed of the 33 sampling contour points and the 7 initial contour points.
[0111] By further encoding the object feature vector, that is, adding contour points on the basis of the initial contour points, the number of contour points is made consistent with the preset number of contour points, ensuring that the data length corresponding to each object is consistent, which facilitates subsequent calculations.
[0112] Step 206: Select at least three target contour points from the set of contour points, and generate a polygon corresponding to the target object based on the at least three target contour points.
[0113] After generating the set of contour points of the target object, it is necessary to filter out the contour points of the target object that are actually used to generate the polygon, that is, the contour points that generate the contour of the target object. Therefore, it is necessary to calculate the degree of association between each contour point and the target object, and then filter out the target contour points based on the degree of association.
[0114] In practical applications, a method for selecting at least three target contour points from the set of contour points may include:
[0115] Determine the contour point value corresponding to the contour point in the contour point set, wherein the contour point value is used to determine that the contour point is a target contour point;
[0116] Based on the contour point values corresponding to the contour points, at least three contour points with contour point values greater than or equal to preset contour point values are selected from the set of contour points as target contour points.
[0117] Here, the contour point value refers to the numerical value of the correlation between the contour point and the target object; the preset contour point value refers to the pre-set contour point value, and contour points with a value less than the preset contour point value are not considered as target contour points of the target object; the target contour point refers to the contour point in the contour point set whose contour point value is greater than or equal to the preset contour point value; since the image corresponding to the target object is a polygon, at least three target contour points need to be determined before the polygon corresponding to the target object can be determined.
[0118] Specifically, the contour point set is input into the contour point filtering module to obtain at least three target contour points output by the contour point filtering module; the contour point filtering module calculates the contour point value corresponding to each contour point in the contour point set; the contour point value of each contour point is compared with the preset contour point value; and the contour points with a value greater than or equal to the preset contour point value are taken as target contour points.
[0119] In one specific embodiment of this specification, the set of contour points of the vehicle object is input to the contour point filtering module; the contour point filtering module calculates the contour point values in the contour point set and compares the contour point values with preset contour point values, and determines the contour point corresponding to the contour point value that is greater than the preset contour point value as the target contour point; the contour point coordinates of the target contour point output by the contour point filtering module are obtained.
[0120] By selecting at least three target contour points from the contour point set, that is, by identifying at least three target contour points in the contour point set that are strongly related to the target object, the accuracy of subsequent polygon generation is avoided by non-target contour points in the contour point set, which facilitates the subsequent generation of the contour of the target object based on at least three target contour points.
[0121] After determining at least three target contour points, a method for generating a polygon corresponding to the target object based on the at least three target contour points may include:
[0122] Determine at least three target contour points corresponding to the target object;
[0123] By sequentially connecting the at least three target contour points with straight lines in a closed loop, the polygon corresponding to the target object is obtained.
[0124] Specifically, after determining the target contour points, the position information of the determined target contour points can be sent to the terminal that can display the image; the terminal connects the target contour points sequentially with straight lines based on the contour point position information to generate a closed-loop polygonal contour, that is, the contour of the target object; a plane is drawn in the polygonal contour to obtain the polygon corresponding to the target object.
[0125] Furthermore, after generating the polygon corresponding to the target object based on the at least three target contour points, the method further includes:
[0126] The identifier box and the polygon are displayed in the image to be processed.
[0127] Specifically, the terminal capable of displaying images renders and displays the image corresponding to the target object based on the contour point position information; furthermore, it can also obtain the position information of the bounding box, and render and display the bounding box corresponding to the target object based on the position information of the bounding box; in practical applications, the bounding box and / or polygon of the target object in the image to be processed can be displayed according to the requirements.
[0128] By generating bounding boxes and / or polygons in the image to be processed, downstream tasks can efficiently determine the location of target objects, thereby enabling further processing of the image.
[0129] The object recognition method of this specification, in response to an object recognition request, identifies a target object from an image to be processed and draws an identification box containing the target object, wherein the target object is an object of a preset type; predicts a set of contour points corresponding to the target object; selects at least three target contour points from the set of contour points, and generates a polygon corresponding to the target object based on the at least three target contour points.
[0130] By simultaneously identifying the bounding box and polygon of the target object in the image to be processed, the problem of overlapping errors caused by identifying the polygon of the target object within the bounding box after determining the bounding box is avoided, thus improving the image recognition accuracy of the target object.
[0131] See Figure 3 , Figure 3 This is a flowchart of another object recognition method provided in one embodiment of this specification, which specifically includes the following steps.
[0132] Step 302: Receive an object recognition request and determine the image to be processed based on the object recognition request, wherein the image to be processed contains a target object.
[0133] Here, an object recognition request refers to a request to identify a target object in an image to be processed; an image to be processed refers to an image containing a target object, and the outline of the target object in the image to be processed is a polygon, such as a map containing buildings, a photo containing cars, etc.; after determining that there is an image to be processed that needs recognition, an object recognition request can be generated based on the image to be processed; a target object refers to an object contained in the image to be processed, such as a building, a car, a bridge, etc. in a map image.
[0134] Specifically, the executable object recognition request terminal receives an object recognition request; parses the object recognition request to obtain the image identifier to be processed; and obtains the image containing the target object based on the image identifier to be processed.
[0135] In one specific embodiment of this application, the client generates an object recognition request for image H based on the user's object recognition requirements for image H; sends the object recognition request to the server; the server receives the object recognition request, parses the object recognition request, and determines that the image to be processed is image H, which contains the target object: a car.
[0136] By identifying the image to be processed, further processing of the image can be carried out subsequently.
[0137] Step 304: Input the image to be processed into the object recognition model, wherein the object recognition model includes a feature extraction module, an encoding module, and a prediction module; the feature extraction module extracts the image feature sequence from the image to be processed; the encoding module encodes the image feature sequence to obtain the object feature vector of the target object in the image to be processed; the prediction module predicts the bounding box and polygon of the target object based on the object feature vector.
[0138] Among them, the object recognition model refers to a neural network model that can output the bounding box information and polygon information of the image to be processed; the feature extraction module refers to a module that can extract multi-scale features and perform position encoding; the encoding module refers to a module that can encode and decode the input image feature sequence to obtain the object feature vector; and the prediction module refers to a module that can output the bounding box information and polygon information of the target object based on the input object feature vector.
[0139] Specifically, the process involves: acquiring multi-scale image features of the image to be processed; performing positional encoding on the multi-scale image features to obtain an image feature sequence corresponding to the image to be processed; determining feature association information corresponding to the image feature sequence; encoding the image feature sequence according to the feature association information to obtain target image multi-scale features containing the feature association information; encoding the target image multi-scale features according to image prediction data; determining the target object based on the encoded object feature vector; determining the object location information corresponding to the target object based on the object feature vector; and drawing the bounding box of the target object based on the object location information.
[0140] While determining the bounding box of the target object, predict the contour points of the target object to obtain the initial contour points and the number of initial contour points. To ensure consistent contour point data length, the following method can be used: Figure 4 Encode the contour point data using any of the encoding methods shown. Specifically, encoding method 1 is as follows: the preset number of contour points is 31, and the initial number of contour points is 8, meaning the difference between the preset number of contour points and the initial number of contour points is 23. Then, the method of padding with zeros at the end is used to make the number of contour points corresponding to each object consistent. That is, after the 8 initial contour points, 23 supplementary data points are directly added to generate the data point set of the target object. At the same time, an identifier is added to each supplementary data point to mark which contour points are zero-padded vertices. The initial contour points are marked as 1, and the zero-padded supplementary data points are marked as 0. Encoding method 2 is as follows: the contour point trajectory is determined based on the 8 initial contour points. While retaining the initial contour points, sample contour points are uniformly collected within the contour point trajectory, that is, 23 sample contour points are collected. These are combined with the initial contour points to generate the contour point set of the target object. The sample contour points are marked as 0, and the initial points are marked as 1, which facilitates subsequent filtering.
[0141] After predicting the set of contour points corresponding to the object, the target contour points are further filtered in the set of contour points. Specifically, the set of contour points is input into the contour point filtering module to obtain at least three target contour points output by the contour point filtering module. The contour point filtering module calculates the contour point value corresponding to each contour point in the set of contour points. The contour point value of each contour point is compared with the preset contour point value. Contour points with a value greater than or equal to the preset contour point value are taken as target contour points.
[0142] Step 306: Obtain the bounding box and polygon of the target object output by the object recognition model.
[0143] Specifically, the position information corresponding to each target contour point output by the object recognition model and the position information corresponding to the bounding box are obtained; a polygon is set on the image to be recognized based on the position information corresponding to each target contour point, and a bounding box is set for the target object based on the position information corresponding to the bounding box.
[0144] In practical applications, the object recognition model is obtained through supervised training, and the object recognition model is trained based on the following steps:
[0145] Obtain sample data and sample labels, wherein the sample data is image sample data, and the sample labels are the target bounding box, target polygon, object classification, and corner point classification of the image sample data, and the target polygon contains target contour points;
[0146] The image sample data is input into the object recognition model;
[0147] Receive the predicted bounding box, predicted polygon, predicted object classification, and predicted corner classification output by the object recognition model;
[0148] Calculate the bounding box loss value based on the predicted bounding box and the target bounding box, and calculate the polygon loss value based on the predicted polygon and the target polygon;
[0149] Calculate the object classification loss value based on the predicted object classification and the object classification, and calculate the corner classification loss value based on the predicted corner classification and the corner classification;
[0150] The object recognition model is iteratively trained based on the bounding box loss value, the polygon loss value, the object classification loss value, and the corner point classification loss value until the training stops.
[0151] Among them, target bounding boxes refer to bounding boxes pre-set for image sample data. These boxes can be drawn manually on the image sample data or drawn using a pre-trained model. Target polygons refer to polygons pre-set for image sample data. Object classification refers to the pre-set classification of objects contained in the image sample data, including target object types and non-target object types. Corner classification refers to the pre-set type of polygon vertices, including corner types and non-corner types. Predicted bounding boxes refer to the bounding box information output by the object recognition model during training. Predicted polygons refer to the polygon information output by the object recognition model during training. Predicted object classification refers to the object classification output by the object recognition model during training, for example, object 1 is a building type and object 2 is a non-building type. Predicted corner classification refers to the vertex type of the polygon output by the object recognition model during training, for example, vertex 1 is a corner type and vertex 2 is a non-corner type.
[0152] Specifically, the object recognition model is iteratively trained based on bounding box loss, polygon loss, object classification loss, and corner classification loss. The bounding box loss is the loss value obtained by calculating the similarity between the target bounding box in the image sample data and the predicted bounding box output by the object recognition model. The polygon loss is the loss value obtained by calculating the similarity between the target polygon in the image sample data and the predicted polygon output by the object recognition model.
[0153] This specification describes an object recognition method that receives an object recognition request and determines an image to be processed based on the request, wherein the image to be processed contains a target object. The image to be processed is then input into an object recognition model, which includes a feature extraction module, an encoding module, and a prediction module. The feature extraction module extracts an image feature sequence from the image to be processed. The encoding module encodes the image feature sequence to obtain an object feature vector of the target object in the image to be processed. The prediction module predicts the bounding box and polygon of the target object based on the object feature vector. The bounding box and polygon of the target object are then obtained as output by the object recognition model. By simultaneously recognizing the bounding box and polygon of the target object in the image to be processed, the method avoids the problem of overlapping errors caused by recognizing the polygon within the bounding box after determining the bounding box, thus improving the accuracy of image recognition of the target object.
[0154] See Figure 5 , Figure 5 This is a schematic diagram of the structure of an object recognition system provided in one embodiment of this specification. The object recognition system includes an end-to-end testing device and a cloud-based testing device, wherein:
[0155] The end-to-end testing device 502 is used to generate an object recognition request based on the image to be processed, and send the object recognition request to the cloud testing device;
[0156] The cloud testing device 504 is used to respond to an object recognition request, identify a target object from an image to be processed, and draw an identification box containing the target object, wherein the target object is an object of a preset type; predict a set of contour points corresponding to the target object; select at least three contour points from the set of contour points, and generate a polygon corresponding to the target object based on the at least three contour points;
[0157] The end-measuring device 502 is also used to display the image to be processed, which includes the identification frame and the polygon.
[0158] The object recognition system described in this specification includes an edge testing device and a cloud testing device. The edge testing device is used to generate an object recognition request based on an image to be processed and send the object recognition request to the cloud testing device. The cloud testing device is used to, in response to the object recognition request, identify a target object from the image to be processed and draw a bounding box containing the target object, wherein the target object is an object of a preset type; predict a set of contour points corresponding to the target object; select at least three contour points from the set of contour points and generate a polygon corresponding to the target object based on the at least three contour points; the edge testing device is also used to display the image to be processed containing the bounding box and the polygon. By simultaneously recognizing the bounding box and the polygon of the target object in the image to be processed, the problem of error overlap caused by recognizing the polygon of the target object within the bounding box after determining the bounding box is avoided, thus improving the image recognition accuracy of the target object.
[0159] Corresponding to the above method embodiments, this specification also provides embodiments of object recognition devices. Figure 6 A schematic diagram of an object recognition device according to one embodiment of this specification is shown. Figure 6 As shown, the device includes:
[0160] The recognition module 602 is configured to, in response to an object recognition request, identify a target object from an image to be processed and draw an identification box containing the target object, wherein the target object is an object of a preset type;
[0161] Prediction module 604 is configured to predict the set of contour points corresponding to the target object;
[0162] The filtering module 606 is configured to filter at least three target contour points from the set of contour points and generate a polygon corresponding to the target object based on the at least three target contour points.
[0163] Optionally, the identification module 602 is further configured to:
[0164] Collect multi-scale image features of the image to be processed;
[0165] The image multi-scale features are positionally encoded to obtain the image feature sequence corresponding to the image to be processed.
[0166] The target object is identified based on the image feature sequence.
[0167] Optionally, the identification module 602 is further configured to:
[0168] Determine the feature association information corresponding to the image feature sequence;
[0169] The image feature sequence is encoded according to the feature association information to obtain multi-scale features of the target image containing the feature association information;
[0170] The target image is encoded with multi-scale features based on image prediction data, and the target object is determined based on the object feature vector obtained by encoding.
[0171] Optionally, the identification module 602 is further configured to:
[0172] The object location information corresponding to the target object is determined based on the object feature vector;
[0173] Draw the identification box of the target object based on the object's location information.
[0174] Optionally, the prediction module 604 is further configured to:
[0175] Determine the initial contour points and the number of initial contour points corresponding to the target object;
[0176] The target object is encoded based on a preset number of contour points and an initial number of contour points to obtain a set of contour points corresponding to the target object, wherein the number of contour points in the set of contour points is consistent with the preset number of contour points.
[0177] Optionally, the prediction module 604 is further configured to:
[0178] Supplementary data points are set based on the preset number of contour points and the initial number of contour points, wherein the supplementary data points include supplementary data point markers;
[0179] Generate a set of contour points corresponding to the target object based on the initial contour points and the supplementary data points.
[0180] Optionally, the prediction module 604 is further configured to:
[0181] Determine the contour trajectory based on the initial contour points;
[0182] According to the preset number of contour points, sample contour points are collected on the contour trajectory;
[0183] Generate a set of contour points corresponding to the target object based on the initial contour points and the sampled contour points.
[0184] Optionally, the filtering module 606 is further configured to:
[0185] Determine the contour point value corresponding to the contour point in the contour point set, wherein the contour point value is used to determine that the contour point is a target contour point;
[0186] Based on the contour point values corresponding to the contour points, at least three contour points with contour point values greater than or equal to preset contour point values are selected from the set of contour points as target contour points.
[0187] Optionally, the filtering module 606 is further configured to:
[0188] Determine at least three target contour points corresponding to the target object;
[0189] By sequentially connecting the at least three target contour points with straight lines in a closed loop, the polygon corresponding to the target object is obtained.
[0190] Optionally, the device further includes a display module configured to:
[0191] The identifier box and the polygon are displayed in the image to be processed.
[0192] The object recognition device of this specification, in response to an object recognition request, identifies a target object from an image to be processed and draws an identification box containing the target object, wherein the target object is an object of a preset type; predicts a set of contour points corresponding to the target object; selects at least three target contour points from the set of contour points, and generates a polygon corresponding to the target object based on the at least three target contour points.
[0193] By simultaneously identifying the bounding box and polygon of the target object in the image to be processed, the problem of overlapping errors caused by identifying the polygon of the target object within the bounding box after determining the bounding box is avoided, thus improving the image recognition accuracy of the target object.
[0194] The above is an illustrative scheme of an object recognition device according to this embodiment. It should be noted that the technical solution of this object recognition device and the technical solution of the object recognition method described above belong to the same concept. For details not described in detail in the technical solution of the object recognition device, please refer to the description of the technical solution of the object recognition method described above.
[0195] Corresponding to the above method embodiments, this specification also provides another embodiment of an object recognition device. Figure 7 A schematic diagram of another object recognition device provided in one embodiment of this specification is shown. Figure 7 As shown, the device includes:
[0196] The receiving module 702 is configured to receive an object recognition request and determine an image to be processed based on the object recognition request, wherein the image to be processed contains a target object;
[0197] The input module 704 is configured to input the image to be processed into an object recognition model, wherein the object recognition model includes a feature extraction module, an encoding module, and a prediction module; the feature extraction module extracts an image feature sequence from the image to be processed; the encoding module encodes the image feature sequence to obtain an object feature vector of a target object in the image to be processed; and the prediction module predicts the bounding box and polygon of the target object based on the object feature vector.
[0198] The acquisition module 706 is configured to acquire the bounding box and polygon of the target object output by the object recognition model.
[0199] Optionally, the object recognition model is trained based on the following steps:
[0200] Obtain sample data and sample labels, wherein the sample data is image sample data, and the sample labels are the target bounding box and the target polygon of the image sample data, and the target polygon contains target contour points;
[0201] The image sample data is input into the object recognition model;
[0202] Receive the predicted bounding box and predicted polygon output by the object recognition model;
[0203] Calculate the bounding box loss value based on the predicted bounding box and the target bounding box, and calculate the polygon loss value based on the predicted polygon and the target polygon;
[0204] The object recognition model is iteratively trained based on the bounding box loss value and the polygon loss value until the training stops.
[0205] Another object recognition device in this specification receives an object recognition request and determines an image to be processed based on the object recognition request, wherein the image to be processed contains a target object; the image to be processed is input into an object recognition model, wherein the object recognition model includes a feature extraction module, an encoding module, and a prediction module; the feature extraction module extracts an image feature sequence from the image to be processed; the encoding module encodes the image feature sequence to obtain an object feature vector of the target object in the image to be processed; the prediction module predicts the bounding box and polygon of the target object based on the object feature vector; and the bounding box and polygon of the target object output by the object recognition model are obtained. By simultaneously recognizing the bounding box and polygon of the target object in the image to be processed, the problem of error overlap caused by recognizing the polygon of the target object within the bounding box after determining the bounding box is avoided, thus improving the image recognition accuracy of the target object.
[0206] The above is an illustrative scheme of another object recognition device according to this embodiment. It should be noted that the technical solution of this object recognition device and the technical solution of the other object recognition method described above belong to the same concept. For details not described in detail in the technical solution of the object recognition device, please refer to the description of the technical solution of the object recognition method described above.
[0207] Figure 8 A structural block diagram of a computing device 800 according to one embodiment of this specification is shown. The components of the computing device 800 include, but are not limited to, a memory 810 and a processor 820. The processor 820 is connected to the memory 810 via a bus 830, and a database 850 is used to store data.
[0208] The computing device 800 also includes an access device 840, which enables the computing device 800 to communicate via one or more networks 860. Examples of these networks include a Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 840 may include one or more of any type of wired or wireless network interface (e.g., a Network Interface Card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) interface, a Wi-MAX interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.
[0209] In one embodiment of this specification, the above-described components of the computing device 800 and Figure 8 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 8The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0210] Computing device 800 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or PCs. Computing device 500 can also be a mobile or stationary server.
[0211] The processor 820 is configured to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the aforementioned data processing method. The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the aforementioned object recognition method belong to the same concept; details not described in detail in the technical solution of the computing device can be found in the description of the technical solution of the aforementioned object recognition method.
[0212] An embodiment of this specification also provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the object identification method described above.
[0213] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the object recognition method described above belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the object recognition method described above.
[0214] An embodiment of this specification also provides a computer program, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the object recognition method described above.
[0215] The above is an illustrative example of a computer program according to this embodiment. It should be noted that the technical solution of this computer program and the technical solution of the object recognition method described above belong to the same concept. Details not described in detail in the technical solution of the computer program can be found in the description of the technical solution of the object recognition method described above.
[0216] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0217] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added to or subtracted according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.
[0218] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.
[0219] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0220] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. An object recognition method, comprising: In response to an object recognition request, multi-scale image features of the image to be processed are acquired, the multi-scale image features are positionally encoded to obtain an image feature sequence corresponding to the image to be processed, feature association information corresponding to the image feature sequence is determined, the image feature sequence is encoded according to the feature association information to obtain target image multi-scale features containing the feature association information, the target image multi-scale features are encoded according to image prediction data, the target object is determined based on the encoded object feature vector, and an identification box containing the target object is drawn, wherein the target object is an object of a preset type, and the identification box is determined based on the object feature vector; Determine the initial contour points and the number of initial contour points corresponding to the target object, encode the target object based on the preset number of contour points and the number of initial contour points, and obtain the contour point set corresponding to the target object, wherein the number of contour points in the contour point set is consistent with the preset number of contour points, and the contour points of the target object are the vertices on the contour corresponding to the target object; Select at least three target contour points from the set of contour points, and generate a polygon corresponding to the target object based on the at least three target contour points.
2. The method as described in claim 1, comprising drawing an identifier box containing the target object, including: The object location information corresponding to the target object is determined based on the object feature vector; Draw the identification box of the target object based on the object's location information.
3. The method as described in claim 1, wherein encoding the target object based on a preset number of contour points and the initial number of contour points to obtain a set of contour points corresponding to the target object includes: Supplementary data points are set based on the preset number of contour points and the initial number of contour points, wherein the supplementary data points include supplementary data point markers; Generate a set of contour points corresponding to the target object based on the initial contour points and the supplementary data points.
4. The method as described in claim 1, wherein the target object is encoded based on a preset number of contour points and the initial number of contour points to obtain a set of contour points corresponding to the target object, comprising: The contour trajectory is determined based on the initial contour points; According to the preset number of contour points, sample contour points are collected on the contour trajectory; Generate a set of contour points corresponding to the target object based on the initial contour points and the sampled contour points.
5. The method of claim 1, wherein filtering at least three target contour points from the set of contour points includes: Determine the contour point value corresponding to the contour point in the contour point set, wherein the contour point value is used to determine that the contour point is a target contour point; Based on the contour point values corresponding to the contour points, at least three contour points with contour point values greater than or equal to preset contour point values are selected from the set of contour points as target contour points.
6. The method of claim 1, wherein generating a polygon corresponding to the target object based on the at least three target contour points comprises: Determine at least three target contour points corresponding to the target object; By sequentially connecting the at least three target contour points with straight lines in a closed loop, the polygon corresponding to the target object is obtained.
7. The method of claim 1, further comprising, after generating the polygon corresponding to the target object based on the at least three target contour points: The identifier box and the polygon are displayed in the image to be processed.
8. An object recognition method, comprising: Receive an object recognition request and determine an image to be processed based on the object recognition request, wherein the image to be processed contains a target object; The image to be processed is input into an object recognition model, which includes a feature extraction module, an encoding module, and a prediction module. The feature extraction module extracts image feature sequences from the image to be processed. The encoding module encodes the image feature sequences to obtain object feature vectors of target objects in the image to be processed. The prediction module predicts bounding boxes and polygons of the target objects based on the object feature vectors. The bounding boxes are determined based on the object feature vectors, and the polygons are determined by predicting a set of contour points corresponding to the target objects. Predicting the set of contour points corresponding to the target objects includes determining initial contour points and the number of initial contour points corresponding to the target objects, encoding the target objects based on a preset number of contour points and the initial number of contour points to obtain a set of contour points corresponding to the target objects. The number of contour points in the set of contour points is consistent with the preset number of contour points. Obtain the bounding box and polygon of the target object output by the object recognition model.
9. The method of claim 8, wherein the object recognition model is trained based on the following steps: acquiring sample data and sample labels, wherein, The sample data is image sample data, and the sample labels are the target bounding box, target polygon, object classification, and corner point classification of the image sample data. The target polygon contains target contour points. The image sample data is input into the object recognition model; Receive the predicted bounding box, predicted polygon, predicted object classification, and predicted corner classification output by the object recognition model; Calculate the bounding box loss value based on the predicted bounding box and the target bounding box, and calculate the polygon loss value based on the predicted polygon and the target polygon; Calculate the object classification loss value based on the predicted object classification and the object classification, and calculate the corner classification loss value based on the predicted corner classification and the corner classification; The object recognition model is iteratively trained based on the bounding box loss value, the polygon loss value, the object classification loss value, and the corner point classification loss value until the training stops.
10. An object recognition system, comprising an edge testing device and a cloud testing device, wherein: The end-to-end testing device is used to generate an object recognition request based on the image to be processed, and send the object recognition request to the cloud testing device; The cloud testing device is configured to, in response to an object recognition request, acquire multi-scale image features of the image to be processed, perform position encoding on the multi-scale image features to obtain an image feature sequence corresponding to the image to be processed, determine feature association information corresponding to the image feature sequence, encode the image feature sequence according to the feature association information to obtain target image multi-scale features containing the feature association information, encode the target image multi-scale features according to image prediction data, determine the target object based on the encoded object feature vector, and draw an identification box containing the target object, wherein the target object is an object of a preset type, and the identification box is determined based on the object feature vector; determine the initial contour points and the number of initial contour points corresponding to the target object, encode the target object based on the preset number of contour points and the number of initial contour points to obtain a contour point set corresponding to the target object, wherein the number of contour points in the contour point set is consistent with the preset number of contour points, and the contour points of the target object are vertices on the contour corresponding to the target object; select at least three contour points from the contour point set, and generate a polygon corresponding to the target object based on the at least three contour points; The end-sensing device is also used to display the image to be processed, which includes the identification frame and the polygon.
11. A computing device, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the object recognition method according to any one of claims 1 to 7 or 8 to 9.
12. A computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the object identification method according to any one of claims 1 to 7 or 8 to 9.