Visual map generation method and device, cleaning robot, and storage medium
By acquiring impassable and passable grids from a grid map, and using object detection models and prior knowledge to correct obstacle categories and bounding boxes, a high-precision visual map is generated. This solves the problem of inaccurate visual recognition in traditional cleaning robots, and achieves low-cost, high-precision map generation with wide applicability.
Patent Information
- Application Number
- CN202611151737.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-30
- Publication Date
- 2026-11-27
AI Technical Summary
Traditional cleaning robots rely on visual data for furniture recognition and reconstruction, which can easily lead to inaccurate positioning. Furthermore, this method is only applicable to devices equipped with visual sensors, resulting in high costs and limited implementation scope.
By acquiring impassable and passable grids from a grid map, an object detection model is used to identify obstacle categories and bounding boxes. These are then corrected using pre-defined prior knowledge to generate a high-precision visual map suitable for cleaning robots without visual sensors.
It improves the accuracy of visual map generation, reduces implementation costs, and expands the scope of application to cleaning robots without visual sensors.
Smart Images

Figure CN123175239A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, apparatus, cleaning robot, computer-readable storage medium, and computer program product for generating visual maps. Background Technology
[0002] Cleaning robots need to avoid collisions with furniture during operation. Therefore, before starting work, the cleaning robot needs to identify furniture in the surrounding environment and reconstruct a floor plan map containing the furniture. In traditional technology, this usually involves first using a camera to collect image information of the surrounding environment, then using an object recognition algorithm to extract the detection boxes containing the furniture from the image information, estimating the depth of the furniture to project the detection boxes onto a grid map, predicting the furniture category recognition result, and using the template box corresponding to the furniture category recognition result to apply to the detection boxes containing the furniture in the grid map to form a floor plan map containing furniture information, thus completing the furniture identification and reconstruction.
[0003] However, this image-based furniture recognition and reconstruction method is only suitable for cleaning robots equipped with visual sensors. Furthermore, because the depth of the furniture may be inaccurately estimated, the final reconstructed furniture position can easily be inaccurate. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, apparatus, cleaning robot, computer-readable storage medium, and computer program product that can generate high-precision visual maps without relying on visual data, addressing the aforementioned technical problems.
[0005] Firstly, this application provides a method for generating a visual map, including:
[0006] Obtain a raster map, which includes impassable and passable rasters;
[0007] Based on the impassable and traversable grids in the grid map, determine the category identification results and target bounding boxes of obstacles in the grid map;
[0008] Based on the obstacle category identification results and the target bounding box, a visual obstacle is generated in the visual map.
[0009] Secondly, this application also provides a visualization map generation apparatus, comprising:
[0010] A map acquisition module is used to acquire a raster map, which includes impassable and traversable rasters.
[0011] An obstacle recognition module is used to determine the category recognition result and target bounding box of obstacles in the grid map based on the impassable and passable grids in the grid map;
[0012] The map generation module is used to generate visual obstacles in a visual map based on the obstacle category identification results and the target bounding box.
[0013] Thirdly, this application also provides a cleaning robot, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the visualization map generation method described in any of the embodiments of the first aspect above.
[0014] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the visualization map generation method described in any of the embodiments of the first aspect above.
[0015] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the visualization map generation method described in any of the embodiments of the first aspect above.
[0016] The aforementioned visualization map generation method, apparatus, cleaning robot, computer-readable storage medium, and computer program product acquire a grid map, determine the category identification results and target bounding boxes of obstacles in the grid map based on the impassable and drivable grids included in the grid map, and then generate corresponding visualized obstacles in the visualized map based on the category identification results and target bounding boxes of obstacles in the grid map. Based on the coordinate transformation relationship between the grid map and the visualized map, the corrected target bounding boxes are mapped to their corresponding positions in the visualized map, and object identifiers corresponding to the corrected category identification results are added to the corresponding positions, forming a visualized map after object reconstruction. This method can directly complete the coordinate mapping in the visualized map based on the spatial occupancy information pre-carried in the grid map, thereby improving the accuracy of visualized map generation. Furthermore, since the above visualization map generation method only relies on the grid map for identification and does not depend on visual data, it can also be applied to cleaning robots without visual sensors, resulting in lower implementation costs and a wider implementation range. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating a map generation method in one embodiment;
[0019] Figure 2 This is a flowchart illustrating the obstacle recognition and visualization generation steps in one embodiment;
[0020] Figure 3 This is a flowchart illustrating the semantic mapping correction steps in one embodiment;
[0021] Figure 4 This is a flowchart illustrating the association category correction steps in one embodiment;
[0022] Figure 5A This is a flowchart illustrating the category identification result verification steps in one embodiment;
[0023] Figure 5B This is a flowchart illustrating the similarity category correction steps in one embodiment;
[0024] Figure 6 This is a flowchart illustrating the steps for removing duplicate obstacles of the same type in one embodiment;
[0025] Figure 7 This is a flowchart illustrating the obstacle merging step in one embodiment;
[0026] Figure 8 This is a flowchart illustrating the obstacle size correction step in one embodiment;
[0027] Figure 9 This is a flowchart illustrating the obstacle identification steps of a target detection model in one embodiment;
[0028] Figure 10 This is a schematic diagram of the structure of target detection model 1000 in one embodiment;
[0029] Figure 11 This is a flowchart illustrating the training steps of an object detection model in one embodiment;
[0030] Figure 12 This is a schematic diagram of raster map sample data in one embodiment;
[0031] Figure 13 This is a schematic diagram of a raster map sample in one embodiment. Detailed Implementation
[0032] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0033] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the solutions, or any combination of multiple solutions. The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with relevant regulations.
[0034] In one exemplary embodiment, such as Figure 1 As shown, a method for generating a visual map is provided. Taking the application of this method to a cleaning robot as an example, the cleaning robot can include, but is not limited to, sweeping robots, sweeping and mopping robots, floor washing robots, and window cleaning robots. In this embodiment, the method includes the following steps S102 to S108. Wherein:
[0035] Step S102: Obtain a grid map, which includes impassable grids and passable grids.
[0036] Among them, grid maps can be used to reflect the distribution of obstacles in the environment where the cleaning robot is located.
[0037] Impassable grids can be used to characterize grids that cleaning robots cannot pass through due to obstacles (such as furniture, walls, etc.).
[0038] Accessible grids can be used to represent the grids corresponding to the free areas that cleaning robots can pass through.
[0039] For example, a grid map containing both drivable and impassable grids can be directly obtained from a local database or data communication network. Alternatively, a cleaning robot can use LiDAR, Time-of-Flight (TOF) sensors, millimeter-wave radar, and infrared array sensors in a coordinated manner to detect the environment and obtain environmental data. Then, the Simultaneous Localization and Mapping (SLAM) algorithm is used to process the environmental data and generate a grid map containing both impassable and drivable grids.
[0040] Step S104: Based on the impassable and passable grids in the grid map, determine the category recognition result of the obstacle in the grid map and the target bounding box.
[0041] The category recognition results can include, but are not limited to, any one of the following categories: sofa, coffee table, bed, TV cabinet, kitchen cabinet, toilet, dining table and chairs.
[0042] The target bounding box can be used to describe information such as the location, size, and orientation of obstacles.
[0043] For example, grid template data corresponding to various obstacles can be pre-stored. Based on the impassable and drivable grids in the grid map, the grid map is matched with various grid template data to identify the category of the obstacle corresponding to the impassable grid and its target bounding box.
[0044] Alternatively, a grid map containing both impassable and passable grids can be input into a neural network model for object detection, thereby obtaining the obstacle category identification results and the bounding boxes of the targets located in the output of the neural network model.
[0045] Alternatively, the geometric features or spatial arrangement features of various obstacles, such as their outline shape and size, can be stored in advance. Based on the outline shape of the impassable grid or the spatial relationship between the passable and impassable grids, the category recognition result of the corresponding obstacle and its bounding box can be determined.
[0046] Step S106: Based on the obstacle category identification results and the target bounding box, generate a visual obstacle in the visual map.
[0047] Among them, the visualization map can be used to represent the visualized floor plan map.
[0048] For example, a raster map can be rendered to obtain a corresponding visualized map. At the target bounding box in the visualized map, corresponding visualized obstacles are generated according to the obstacle category identification results. Alternatively, a visualized map can be obtained from a local database or data communication network. Based on the coordinate mapping relationship between the raster map and the visualized map, the corresponding position of the target bounding box in the visualized map is determined. Then, at the corresponding position, corresponding visualized obstacles are generated according to the obstacle category identification results.
[0049] The aforementioned visualization map generation method acquires a grid map, determines the category identification results and target bounding boxes of obstacles in the grid map based on the impassable and drivable grids included in the grid map, and then generates corresponding visualized obstacles in the visualization map based on the obstacle category identification results and target bounding boxes in the grid map. It can directly complete the coordinate mapping in the visualization map by relying on the spatial occupancy information pre-carried in the grid map, thereby improving the accuracy of visualization map generation. Furthermore, since the above visualization map generation method only relies on the grid map for identification and does not depend on visual data, it can also be applied to cleaning robots without visual sensors, resulting in lower implementation costs and a wider range of applications.
[0050] In one exemplary embodiment, such as Figure 2 As shown, steps S104 and S106 may include steps S202 to S206. Wherein:
[0051] Step S202: Use the target detection model to extract features of impassable and passable grids, and identify obstacles in the grid map based on the extracted features, and determine the category recognition results of the obstacles and the target bounding box.
[0052] Among them, the object detection model can be used to characterize a detection model based on a deep learning network.
[0053] For example, during the model training phase, a large number of grid map samples can be collected as training data, and the category of each obstacle in the grid map samples and its bounding box can be labeled to form corresponding training labels. The training data is input into a deep learning network for training, and the model parameters of the deep learning network are adjusted in conjunction with the training labels to obtain an object detection model. In the application phase, the currently acquired grid map can be input into the object detection model. The object detection model extracts the features of impassable and drivable grids in the grid map, and uses the features of impassable and drivable grids in the current grid map and the features of the grid map samples learned during the model training phase to perform similarity calculation, thereby determining the category recognition result of the obstacle in the current grid map and its corresponding target bounding box.
[0054] Step S204: Correct the category recognition result and / or target bounding box by combining preset prior knowledge.
[0055] Prior knowledge includes semantic constraints and / or geometric constraints.
[0056] Semantic constraints can be used to constrain at least one of the following: the semantic mapping relationship between an object category and the type of its region, and the semantic association relationship between multiple object categories.
[0057] Geometric constraints can be used to constrain at least one of the following: the geometric mapping relationship between object category and object size, the geometric overlap relationship between an object and a wall, and the geometric positional relationship between objects of the same type.
[0058] For example, based on pre-defined prior knowledge, it can be determined whether the obstacle category identification results and target bounding boxes output by the object detection model conform to semantic and / or geometric constraints. If they do not conform to prior knowledge, the obstacle category identification results and / or target bounding boxes are corrected in a way that conforms to prior knowledge to obtain corrected category identification results and / or target bounding boxes. If they conform to prior knowledge, the category identification results and / or target bounding boxes output by the object detection model are directly used as the corrected category identification results and / or target bounding boxes.
[0059] Step S206: Based on the coordinate transformation relationship between the raster map and the visualization map, the corrected target bounding box is mapped to the corresponding position in the visualization map, and an object label corresponding to the corrected category recognition result is added at the corresponding position to form a visualization obstacle.
[0060] The object identifier can include, but is not limited to, visual content in the form of images, barcodes, text, icons, or color blocks.
[0061] For example, for the obstacle-corrected category recognition result and the target bounding box: based on the coordinate transformation relationship between the raster map and the visualization map, the corrected target bounding box can be transformed to map the corrected target bounding box to its corresponding position in the visualization map. The object identifier corresponding to the corrected category recognition result is then obtained. The object identifier corresponding to the corrected category recognition result is added to the corresponding position in the visualization map to form the corresponding visualized obstacle, achieving high-precision reconstruction by combining the visualization map with obstacle classification and localization.
[0062] In this embodiment, the object detection model is used to determine the category identification results and target bounding boxes of obstacles in the grid map. The category identification results and / or target bounding boxes are corrected by combining preset prior knowledge. Based on the coordinate transformation relationship between the grid map and the visualization map, the corrected target bounding boxes are mapped to the corresponding positions in the visualization map. Object icons corresponding to the corrected category identification results are added to the corresponding positions to form the corresponding visualized obstacles. The object detection model can directly classify and locate obstacles in the grid map and correct them by combining prior knowledge, so that the corrected category identification results and target bounding boxes have higher data accuracy, thereby improving the generation accuracy of the visualization map.
[0063] In one exemplary embodiment, the prior knowledge includes geometric constraints. These geometric constraints can be used to ensure that the proportion of the object's bounding box area extending beyond the outer wall region does not exceed a preset threshold.
[0064] Step S106 above includes: determining the outer wall area based on the impassable and passable grids in the grid map; determining the area ratio of the target bounding box that exceeds the outer wall area in the grid map; and deleting the category recognition result and target bounding box of the corresponding obstacle in response to the area ratio being greater than a preset threshold in the geometric constraints, thereby obtaining the corrected category recognition result and the corrected target bounding box.
[0065] The exterior wall area refers to the occupied raster connected domain located at the boundary of the explored area in the raster map, used to separate indoor vacant rasters from unknown outdoor rasters.
[0066] For example, connected component analysis can be performed on impassable and accessible graticets in the raster map, and the outer wall region can be selected from the connected components based on the definition of the outer wall region. Alternatively, contour extraction can be performed on impassable and accessible graticets in the raster map, and the largest closed contour located on the outermost side of the raster map and surrounding all free areas can be taken as the outer wall region. Alternatively, semantic annotation data of impassable and accessible graticets in the raster map can be obtained, and the outer wall region can be located based on the semantic annotation data. Geometric constraints are used to judge obstacles identified by the target detection model one by one: determine the area of the target bounding box of the obstacle identified by the target detection model that exceeds the outer wall region, and the area occupied by the target bounding box. Divide the area of the target bounding box that exceeds the outer wall region by the area of the target bounding box to obtain the area ratio. Geometric constraints are used to judge the target bounding box: compare the area ratio with a preset threshold in the geometric constraints. If the area ratio is greater than the preset threshold, it means that the target bounding box does not meet the geometric constraints. Therefore, in response to an area ratio greater than a preset threshold, the target bounding box and the corresponding obstacle category identification result are deleted. After traversing all obstacles identified by the target detection model, the target bounding boxes of obstacles with an area ratio less than or equal to the preset threshold, along with their corresponding category identification results, are used as the corrected target bounding boxes and corrected category identification results.
[0067] In this embodiment, by determining the area ratio of the target bounding box that exceeds the outer wall area in the raster map, the comparison result of the area ratio with the preset threshold in the geometric constraints is used to determine whether the target bounding box meets the geometric constraints. The target bounding box and its category recognition result of obstacles with an area ratio greater than the preset threshold are deleted to correct the recognition result of the target detection model. This can filter out misidentified obstacles and improve the accuracy of the corrected target bounding box and its corresponding category recognition result.
[0068] In one embodiment, the prior knowledge includes geometric constraints. These geometric constraints can be used to partition an object to the side with the larger area when the object's bounding box crosses an inner wall region.
[0069] Step S106 above includes: determining the inner wall region based on the impassable and passable grids in the grid map; when the target bounding box crosses the inner wall region in the grid map, determining the first area of the target bounding box on one side of the inner wall region and the second area on the other side of the inner wall region; when the first area is greater than the second area, moving the target bounding box to the side corresponding to the first area based on geometric constraints to obtain the corrected target bounding box.
[0070] The interior wall area refers to the occupied raster connected domain located within the explored area of the raster map, used to divide the empty raster inside the room into multiple independent sub-regions.
[0071] For example, referring to the external wall region identification method provided in the above embodiments, connected component analysis, contour extraction, or semantic annotation can be used to analyze and process the impassable and traversable grids in the raster map to locate the internal wall region. The location of the target bounding box is compared with the location of the internal wall region. If it is determined that the target bounding box crosses the internal wall region, the area occupied by the target bounding box on one side of the internal wall region is calculated as the first area, and the area occupied by the target bounding box on the other side of the internal wall region is calculated as the second area. The first area and the second area are compared. If the first area is larger than the second area, based on geometric constraints, the target bounding box is moved to the side corresponding to the larger first area. For example, the target bounding box can be completely translated to the side corresponding to the first area, so that the moved target bounding box is entirely located on the side corresponding to the first area. The moved target bounding box is then used as the corrected target bounding box.
[0072] In this embodiment, when the target bounding box crosses the inner wall area in the grid map, the target bounding box is moved to the side with a larger area based on geometric constraints to obtain a modified target bounding box. This can correct the positional conflict of the target bounding box crossing the inner wall area and improve the positional semantic rationality of the modified target bounding box in the actual scene.
[0073] In one exemplary embodiment, the prior knowledge may further include semantic constraints. Semantic constraints can be used to partition an object bounding box to the side where the region type matches the object category, provided that the object bounding box spans an inner wall region and the areas of the object bounding box on both sides of the inner wall region are equal.
[0074] The visualization map generation method provided in this application may further include: when the first area is equal to the second area, determining the target region type corresponding to the obstacle category recognition result based on the semantic mapping relationship between the region type and the object category in the semantic constraints, and moving the target bounding box of the obstacle to the side that matches the target region type based on the semantic constraints to obtain the corrected target bounding box.
[0075] Semantic mapping relationships can be used to identify object categories that can or cannot exist under a region type. Region types can include, but are not limited to, bathroom types, kitchen types, and living / dining room types (including living room and dining room types). Object categories can include, but are not limited to, toilet categories, cabinet categories, sofa categories, coffee table categories, TV cabinet categories, dining table and chair categories (including dining table and chair categories), bed categories, and bedside table categories.
[0076] Optionally, in some implementations, the semantic mapping relationship may include, but is not limited to, a reasonable mapping relationship between toilet type and toilet category (i.e., objects of the toilet category are allowed to exist in the area of toilet type) and / or a conflict mapping relationship between toilet type and categories such as bed, sofa, coffee table, etc. (i.e., objects of the bed, sofa, coffee table, etc. are not allowed to exist in the area of toilet type).
[0077] Optionally, in other implementations, semantic mapping relationships may include, but are not limited to, a reasonable mapping relationship between kitchen type and cabinet category (i.e., objects of cabinet category are allowed to exist in the area of kitchen type) and / or a conflict mapping relationship between kitchen type and categories such as toilet, TV cabinet, bed, etc. (i.e., objects of categories such as toilet, TV cabinet, bed, etc. are not allowed to exist in the area of kitchen type).
[0078] Optionally, in other implementations, the semantic mapping relationship may include, but is not limited to, a reasonable mapping relationship between the living room / dining room type and categories such as sofa, coffee table, TV cabinet, dining table and chairs (i.e., objects of categories such as sofa, coffee table, TV cabinet, dining table and chairs are allowed to exist in the area of the living room / dining room type) or a conflict mapping relationship between the living room / dining room type and the toilet category (i.e., objects of the toilet category are not allowed to exist in the area of the living room / dining room type).
[0079] For example, if the target bounding box crosses the inner wall region, and the first area and second area of the target bounding box on both sides of the inner wall region are equal, the following correction operation is performed:
[0080] Semantic annotation data from a raster map can be acquired, and the region types on both sides of the inner wall area spanned by the target bounding box can be determined based on this data. According to the obstacle category identification results corresponding to the target bounding box and the reasonable mapping relationship between region types and object categories in the semantic constraints, the target region type for which category identification results are allowed can be determined. Alternatively, based on the conflict mapping relationship between region types and object categories in the semantic constraints and the category identification results, conflict region types for which category identification results are not allowed can be determined, and other region types besides conflict region types can be used as the target region type. From the regions on both sides of the inner wall area, the side matching the target region type is identified. Based on the semantic constraints, the entire target bounding box is moved to the side matching the target region type, so that the moved target bounding box is entirely located on the side matching the target region type, resulting in the corrected target bounding box.
[0081] In this embodiment, when the target bounding box spans the inner wall area and the areas on both sides of the inner wall area are equal, the target bounding box is moved to the side of the target area type corresponding to the category recognition result based on the semantic mapping relationship between the area type and the object category in the semantic constraints. This results in a corrected target bounding box, which avoids semantic conflicts between the area type of the target bounding box and the category recognition result of the obstacle, thereby improving the accuracy of the corrected target bounding box.
[0082] In one exemplary embodiment, prior knowledge may include semantic constraints. Semantic constraints can be used to constrain the region where an object is located based on semantic mapping relationships. Semantic mapping relationships may include, but are not limited to, the reasonable mapping relationships and conflicting mapping relationships disclosed in the above embodiments.
[0083] like Figure 3 As shown, step S106 includes steps S302 to S308, wherein:
[0084] Step S302: Determine the region type of the area where the target bounding box of the obstacle is located based on the partition information corresponding to the grid map.
[0085] The zoning information describes the location of each independent spatial region in the raster map and its corresponding region type.
[0086] For example, the partition information corresponding to the raster map can be obtained directly from a local database or data communication network. Alternatively, semantic segmentation processing can be performed on the raster map to obtain the corresponding partition information. Alternatively, geometric segmentation can be performed on the raster map, and combined with the floor plan or semantic annotation data of the surrounding environment, to determine the type of each segmented area, forming the corresponding partition information. Based on the location of the target bounding box of the obstacle and the area type matching that location in the partition information, the area type of the region where the target bounding box is located is determined.
[0087] Step S304: Determine the target object category corresponding to the region type based on the semantic mapping relationship between the region type and the object category in the semantic constraints.
[0088] Step S306: If the target object category and the obstacle category recognition result are different, delete the corresponding obstacle category recognition result and the target bounding box.
[0089] Step S308: The category recognition results of the remaining obstacles after deletion and the target bounding box are respectively used as the corrected category recognition results and the corrected target bounding box.
[0090] For example, the target object category can be determined by utilizing the region type matched by the target bounding box and combining the semantic mapping relationship between region type and object category in the semantic constraints. The target object category matched by the target bounding box is then matched with the obstacle category recognition result. If the target object category and the category recognition result differ, the corresponding obstacle category recognition result and target bounding box are deleted. The remaining obstacle category recognition result and target bounding box are then used as the corrected category recognition result and corrected target bounding box, respectively.
[0091] In this embodiment, by determining the region type of the area where the target bounding box of the obstacle is located, and combining semantic constraints to determine the target object category corresponding to the region type, the category of the obstacle identified by the target detection model is judged using the target object category as a reference. The bounding boxes and category identification results of obstacles whose category identification results are different from the target object category are deleted. This can avoid the problem of semantic conflict between the target bounding box of the same obstacle and the category identification result, and improve the accuracy of the corrected category identification result and the target bounding box.
[0092] In one exemplary embodiment, prior knowledge may include semantic constraints, which may store the relationships between object categories and the object association distances between objects of different categories with relationships. Semantic constraints can be used to distinguish similar and easily confused object categories by combining the relationships between object categories and the object categories within the object association distance. The object categories with relationships may include, but are not limited to, sofa and coffee table categories, bed and bedside table categories, dining table and chair categories, etc. Optionally, in some embodiments, object categories that are similar to and easily confused with the coffee table category may include, but are not limited to, the bedside table category, the dining table category, etc., and object categories that are similar to and easily confused with the bedside table category may include, but are not limited to, the coffee table category, etc.
[0093] like Figure 4 As shown, step S106 includes steps S402 to S406. Wherein:
[0094] Step S402: Based on the association relationship between object categories in the semantic constraints, determine the associated category corresponding to the category recognition result of the obstacle, and the object association distance between the category recognition result and the associated category.
[0095] For example, the obstacle category identification results identified by the object detection model can be used, combined with the association relationship between object categories in the semantic constraints, to determine the object category that is related to the obstacle category identification results as the associated category, and to determine the object association distance between the category identification results and the associated category.
[0096] Step S404: Determine the associated search range based on the target bounding box and object association distance in the semantic constraints, and search for other obstacles within the associated search range.
[0097] For example, the search range can be determined by using the center point of the obstacle's target bounding box as the search starting point and the object association distance as the search distance. Within the association search range corresponding to the obstacle in the raster map, the search is performed to determine whether there are other obstacles and other obstacle category identification results.
[0098] In step S406, if no other obstacles under the associated category are found within the associated search range, and if other obstacles belonging to a preset category similar to the associated category exist within the associated search range, the category identification results of the other obstacles are corrected to the associated category to obtain the corrected category identification results of the other obstacles.
[0099] The preset category refers to the category of objects that are similar to or easily confused with the associated category.
[0100] For example, if no other obstacles in the associated category are found within the association search range of the obstacle, and other obstacles belonging to a preset category similar to the associated category exist within the association search range, it can be determined that the object detection model has misidentified the other obstacles in the associated category as obstacles in the similar preset category. The category identification results of the other obstacles are then corrected to the associated category, thereby obtaining the corrected category identification result of the obstacle.
[0101] Optionally, in some implementations, the object association distance between the sofa category and the coffee table category can be 1 meter. If the obstacle's category identification result is sofa, other obstacles within 1 meter of that obstacle can be searched. If only other obstacles of the bedside table or dining table category are found, the category identification result of the other searched obstacles is corrected to coffee table.
[0102] Optionally, in some embodiments, the object association distance between the bed category and the bedside table category can be 0.5 meters. If the obstacle's category identification result is a bed, other obstacles within 0.5 meters of that obstacle can be searched. If only other obstacles of the coffee table category are found, the category identification result of those other obstacles is corrected to the bedside table category.
[0103] Optionally, in other embodiments, if the category identification results of other obstacles found within the associated search range belong to the associated category, then the category identification results of the obstacle are directly used as the corrected category identification results.
[0104] In this embodiment, by utilizing the association relationship between object categories and the object association distance in the semantic constraints, other obstacles that are within the object association distance of the target bounding box of the obstacle are searched. If no other obstacles under the associated category are found within the association search range, and if other obstacles belonging to a preset category similar to the associated category exist within the association search range, the category identification result of the other obstacles is corrected to the associated category, and the corrected category identification result of the other obstacles is obtained. This can utilize the prior knowledge of the spatial distance between obstacles of different categories with association relationships to correct the misjudgment of object categories and improve the accuracy of the corrected category identification result.
[0105] In one exemplary embodiment, prior knowledge may include semantic constraints. Semantic constraints can be used to distinguish easily confused object categories by combining the semantic mapping relationship between object categories and region types, as well as the association relationship between object categories. Optionally, in some implementations, semantic constraints can be used to distinguish objects of the coffee table category from objects of the dining table category.
[0106] like Figure 5AAs shown, step S106 includes steps S502 to S510. Wherein:
[0107] Step S502: Determine the region type of the area where the target bounding box of the obstacle is located based on the partition information corresponding to the grid map.
[0108] Step S504: Determine the target region type corresponding to the obstacle category recognition result based on the semantic mapping relationship between the region type and the object category in the semantic constraints.
[0109] For example, the region segmentation results can be matched with the target bounding box to determine the region type of the area where the target bounding box is located. Using the obstacle category recognition results and combining them with the semantic mapping relationship in the semantic constraints, the target region type corresponding to the category recognition results is determined. Finally, it is determined whether the region type corresponding to the target bounding box is consistent with the target region type corresponding to the category recognition results.
[0110] Step S506: Determine the associated category corresponding to the obstacle category recognition result based on the association relationship between object categories in the semantic constraints.
[0111] Step S508: Based on the object association distance corresponding to the association category in the semantic constraints, search for other obstacles whose target bounding boxes are within the object association distance.
[0112] For example, the category identification result of the obstacle can be combined with the association relationship in the semantic constraints to determine the associated category corresponding to the category identification result of the obstacle. Using the point in the target bounding box of the obstacle as the search starting point, other obstacles within the object association distance are searched. It is then determined whether the category identification results of the other obstacles belong to the associated category.
[0113] In step S510, if the region type is consistent with the target region type, and there are other obstacles within the object association distance whose category recognition results belong to the associated category, the category recognition results of the obstacles are used as the corrected category recognition results.
[0114] For example, if the type of the region where the target bounding box is located is consistent with the type of the target region corresponding to the category recognition result, and other obstacles found within the object association distance belong to the category recognition result, the category recognition result of the obstacle is used as the corrected category recognition result.
[0115] Optionally, in some implementations, if the obstacle category identified by the object detection model is a coffee table, then the target region type corresponding to the category identification result can be determined to be a living room type based on semantic constraints. If the region type of the area where the target bounding box of the obstacle is located, as identified by the object detection model, is also a living room type, then the region type of the obstacle is consistent with the target region type. Simultaneously, the associated category corresponding to the obstacle's category identification result can be determined to be a sofa type based on semantic constraints. If other obstacles of the sofa type are found within the object distance range of the obstacle, then the category identification result of the obstacle can be determined to be a coffee table.
[0116] In this embodiment, the semantic mapping relationship between object category and region type in the semantic constraints is used to determine whether there is a conflict between the obstacle category recognition result identified by the target detection model and the target bounding box. Furthermore, by combining the association relationship between object categories in the semantic constraints and the object association distance, it is determined whether there are other obstacles belonging to the associated category within the object association distance. This allows for double verification of the category recognition result and improves the accuracy of the category recognition result.
[0117] In one exemplary embodiment, prior knowledge may further include geometric constraints. Geometric constraints can be used to constrain the geometric mapping relationship between object categories and object dimensions. For example, geometric constraints can be used to constrain the aspect ratio of objects corresponding to the "dining table" category to be greater than 1.5.
[0118] like Figure 5B As shown, it may also include steps S512 to S518. Wherein:
[0119] Step S512: In cases where the region type is inconsistent with the target region type, and / or there are no other obstacles within the object association distance whose category recognition results belong to the associated category, a preset category similar to the category recognition results of the obstacle is determined based on semantic constraints.
[0120] For example, if the region type is inconsistent with the target region type, and / or there are no other obstacles within the object's associated distance whose category identification results belong to the associated category, it can be determined that the current category identification result of the obstacle is incorrect. Object categories that are similar to and easily confused with the obstacle's category identification result are determined from the semantic constraints as similar preset categories.
[0121] Step S514: Determine the preset region type corresponding to the preset category of obstacle based on the semantic mapping relationship between region type and object category in the semantic constraints.
[0122] Step S516: Determine the aspect ratio threshold of the object corresponding to the preset category in the geometric constraints.
[0123] Step S518: If the region type is consistent with the preset region type and the aspect ratio of the obstacle is greater than the aspect ratio threshold of the object, the obstacle category recognition result is corrected to the preset category to obtain the corrected obstacle category recognition result.
[0124] For example, the semantic mapping relationship of semantic constraints can be used to determine the preset region type corresponding to the preset category, and the geometric mapping relationship of geometric constraints can be used to determine the aspect ratio threshold of the object corresponding to the preset category. The region type corresponding to the target bounding box of the obstacle is then matched with the preset region type corresponding to the preset category, and the aspect ratio of the obstacle is matched with the aspect ratio threshold of the object corresponding to the preset category. If the region type matches the preset region type, and the aspect ratio of the obstacle is greater than the aspect ratio threshold, the obstacle's category recognition result is corrected to the preset category, resulting in the corrected category recognition result for the obstacle.
[0125] Optionally, in some implementations, if the obstacle's category identification result is coffee table, but the area type where the obstacle is located is restaurant type, and the aspect ratio of the obstacle is greater than 1.5, then the obstacle's category identification result can be corrected to dining table type.
[0126] In this embodiment, when the obstacle category is incorrect, semantic constraints and geometric constraints are combined to determine whether the obstacle belongs to a preset category that is similar to and easily confused with the category recognition result. This corrects the category recognition result of the obstacle, avoids misjudging similar and easily confused obstacles, and improves the accuracy of the corrected category recognition result.
[0127] In one exemplary embodiment, semantic constraints can be used to restrict that there is only one object of a certain category within the same area. For example, there is typically only one toilet, coffee table, or TV cabinet within the same area. If multiple objects of the same category exist within the same area, and the distance between each object is less than a preset distance threshold, it may be due to repeated identification of the same object, requiring correction.
[0128] like Figure 6 As shown, step S106 includes steps S602 to S608. Wherein:
[0129] Step S602: Based on the target bounding box of the obstacle and the partition information of the grid map, determine multiple obstacles located in the same area.
[0130] For example, obstacles in each region of the grid map can be determined by matching the location of the target bounding box with the partition information of the grid map, and multiple obstacles in the same region can be used as the judgment objects in this embodiment.
[0131] Step S604: Within the same area, determine the distance between multiple obstacles with the same category recognition result.
[0132] For example, multiple obstacles located within the same area and with the same category recognition result can be identified based on the category recognition result. The distance between two obstacles with the same category recognition result is calculated using the center point of the target bounding box, and the distance is compared with a distance threshold.
[0133] Step S606: If the distance is less than the distance threshold in the semantic constraints, determine the confidence levels of the first obstacle and the second obstacle corresponding to the distance.
[0134] For example, if the distance is less than the distance threshold in the semantic constraints, the two obstacles corresponding to that distance can be designated as the first obstacle and the second obstacle. The confidence levels for identifying the first obstacle and the second obstacle are then obtained. The confidence levels for the first obstacle and the second obstacle are then compared.
[0135] In step S608, if the confidence level of the first obstacle is higher than that of the second obstacle, the category identification result and target bounding box of the first obstacle are used as the corrected category identification result and target bounding box, and the category identification result and target bounding box of the second obstacle are deleted.
[0136] For example, if the confidence level of the first obstacle is higher than that of the second obstacle, the category identification result and target bounding box of the first obstacle can be used as the corrected category identification result and target bounding box of the first obstacle, and the category identification result and target bounding box of the second obstacle can be deleted.
[0137] Optionally, in some implementations, the distance threshold can be 0.5 meters. If multiple obstacles of the toilet category, multiple obstacles of the coffee table category, or multiple obstacles of the TV cabinet category are identified in the same area, and the distance between obstacles of the same category is less than 0.5 meters, then only the obstacle with the highest confidence in the same category is retained, and other obstacles in the same category are deleted.
[0138] In this embodiment, by using confidence levels to correct obstacles in the same area with the same category recognition results, it is possible to remove duplicate obstacles of the same type in the same area, thereby improving the accuracy of the corrected category recognition results and the target bounding box.
[0139] In one exemplary embodiment, prior knowledge may include semantic constraints. Semantic constraints can be used to merge multiple side-by-side or parallel obstacles under a mergeable category, as well as the mapping relationship between the number of objects in a mergeable category and the object category.
[0140] like Figure 7 As shown, step S106 includes steps S702 to S706. Wherein:
[0141] Step S702: Identify multiple obstacles with the same category recognition result and whose target bounding boxes are side by side or adjacent to each other.
[0142] For example, multiple obstacles of the same category can be identified based on the category recognition result. Based on the target bounding boxes of the multiple obstacles of the same category, multiple obstacles whose target bounding boxes are arranged horizontally and whose center point distance between target bounding boxes is less than a merge distance threshold are identified as multiple obstacles side-by-side; or, multiple obstacles whose target bounding boxes are arranged vertically and whose center point distance between target bounding boxes is less than a merge distance threshold are identified as multiple obstacles in parallel columns.
[0143] Step S704: If the category recognition result belongs to a mergeable category in the semantic constraints, determine the object category corresponding to the number of multiple obstacles based on the number of multiple obstacles and the mapping relationship between the number of objects and the object category in the semantic constraints, and use this as the corrected category recognition result.
[0144] Step S706: Merge the target bounding boxes of multiple obstacles to obtain the corrected target bounding box.
[0145] For example, if the category identification results of multiple side-by-side or parallel obstacles determined in step S702 belong to mergeable categories in the semantic constraints, the following clustering operation is performed: based on the number of side-by-side or parallel obstacles and the mapping relationship between the number of objects and object categories in the semantic constraints, the object category corresponding to the number of side-by-side or parallel obstacles is determined as the corrected category identification result. The target bounding boxes of the multiple side-by-side or parallel obstacles are merged as the corrected target bounding boxes.
[0146] Optionally, in some implementations, the categories that can be merged may include, but are not limited to, sofas, beds, etc. For the sofa category: if two single sofas exist, they can be merged into one double sofa. If more than two single sofas exist, they can be merged into one multi-seater sofa.
[0147] In this embodiment, by identifying multiple obstacles that are side by side or in parallel under the same mergeable category, the category of the merged object is re-determined based on the number of obstacles as the corrected category recognition result, and the target bounding box of the merged obstacles is used as the corrected target bounding box. This can improve the spatial aggregation degree of the identified obstacles, thereby improving the accuracy of the corrected category recognition result and the target bounding box.
[0148] In one exemplary embodiment, prior knowledge may include geometric constraints. Geometric constraints can be used to further subdivide objects of a classifiable category into subcategories based on their aspect ratio.
[0149] Step S106 may include: if the obstacle's category recognition result is separable, determining the obstacle's aspect ratio based on the obstacle's target bounding box, and determining the sub-category corresponding to the obstacle's aspect ratio based on the obstacle's category recognition result, the obstacle's aspect ratio, and the mapping relationship between the aspect ratio in the geometric constraints and the sub-category under the category recognition result, as the corrected category recognition result.
[0150] For example, obstacles belonging to categorizable classes can be filtered out using the class recognition results, and the aspect ratio of the obstacles can be calculated using the target bounding box of the obstacles. Based on the class recognition results of the obstacles, the sub-classes corresponding to the class recognition results are determined from the geometric constraints. Based on the aspect ratio of the obstacles and the mapping relationship between the aspect ratio and sub-classes in the geometric constraints, the sub-classes corresponding to the aspect ratio of the obstacles are determined as the corrected class recognition results for the obstacles.
[0151] Optionally, in some embodiments, the categorization can include, but is not limited to, sofa, bed, or chair categories. For the sofa category: if the aspect ratio of the obstacle is 1 to 1.5, the corresponding subcategory can be determined as a single sofa, with a typical size of 80 cm x 70 cm in actual physical space. If the aspect ratio of the obstacle is 1.5 to 2.4, the corresponding subcategory can be determined as a two-seater sofa, with a typical size of 140 cm x 70 cm in actual physical space. If the aspect ratio of the obstacle is greater than 2.5, the corresponding subcategory can be determined as a three-seater sofa or a multi-seater sofa, with a typical size of 230 cm x 70 cm in actual physical space. For the bed category: if the aspect ratio of the obstacle is 1 to 1.66, the corresponding subcategory can be determined as a single bed, with a typical size of 150 cm x 200 cm in actual physical space. If the aspect ratio of the obstacle is greater than 1.66, then its corresponding subcategory can be determined as the double bed category, and the typical size in actual physical space can be 180 cm x 200 cm.
[0152] In this embodiment, by combining the aspect ratio of the obstacles, the obstacles under the categorizable categories are further divided into corresponding subcategories, which can improve the accuracy of the corrected category recognition results.
[0153] In one exemplary embodiment, prior knowledge may include geometric constraints. Geometric constraints can be used to constrain the mapping relationship between object categories and object dimensions.
[0154] like Figure 8 As shown, step S106 may include steps S802 to S806. Wherein:
[0155] Step S802: Determine the size parameters of the obstacle based on the target bounding box of the obstacle.
[0156] Step S804: Based on the mapping relationship between the object category and the object size in the geometric constraints, determine the preset size parameters corresponding to the obstacle category recognition result.
[0157] Step S806: If the size parameters are inconsistent with the preset size parameters, correct the target bounding box of the obstacle according to the preset size parameters to obtain the corrected target bounding box.
[0158] For example, the size parameters of an obstacle can be calculated using its target bounding box. Using the obstacle's category identification result, combined with the pre-defined mapping relationship between object categories and object sizes in the geometric constraints, a preset size parameter corresponding to the obstacle's category identification result is determined. The calculated size parameter is then matched with the preset size parameter. If the size parameter and the preset size parameter are inconsistent, the obstacle's target bounding box is corrected according to the preset size parameter: for example, the center point of the target bounding box can be used as the origin, and a new bounding box can be reconstructed according to the preset size parameter as the corrected target bounding box. Alternatively, if the length of the target bounding box is less than the preset size parameter, the corresponding area can be added at a preset position in the target bounding box according to the preset size parameter to obtain the corrected target bounding box.
[0159] Optionally, in some implementations, the cleaning robot may only be able to fully identify the foot of the bed when scanning the environment, but cannot build a complete grid map of the head of the bed. Therefore, for obstacles whose category is identified as bed: if the length of the target bounding box of the obstacle is less than 1.5 meters, it can be supplemented at the head of the bed corresponding to the target bounding box according to the preset size parameter corresponding to the bed category—a length of 1.5 meters—so that the length of the corrected target bounding box is the standard size of 1.5 meters.
[0160] Optionally, in other implementations, since there are usually obstructions near the toilet that affect the cleaning robot's ability to recognize the toilet's size, a uniform preset size parameter can be used as the toilet's size standard. For obstacles whose category is identified as toilets: if the identified category is toilet, the center point of the target bounding box identified by the object detection model can be used as the center point of the obstacle, and the corresponding bounding box can be reconstructed according to the preset size parameter as the corrected target bounding box.
[0161] In this embodiment, by determining the preset size parameters corresponding to the obstacle category recognition result based on the mapping relationship between the object category and the object size in the geometric constraints, the target bounding box of the obstacle can be corrected according to the preset size parameters when the size parameters are inconsistent with the preset size parameters. This can solve the problem of incomplete mapping of the cleaning robot or the influence of debris during mapping data collection, and improve the accuracy of the corrected target bounding box.
[0162] In one exemplary embodiment, such as Figure 9 As shown, step S104 includes steps S902 to S908. Wherein:
[0163] In step S902, the grid map is input into the target detection model, and the backbone network of the target detection model is used to extract features based on impassable and passable grids during multiple downsampling operations to obtain multiple original feature maps of different scales.
[0164] For example, such as Figure 10 As shown, the object detection model 1000 may include a backbone feature extraction module 1002, a multi-scale feature bidirectional fusion pyramid module 1004, and a detection prediction module 1006. A grid map containing both passable and impassable grids can be input into the object detection model 1000. Using the backbone feature extraction module 1002 as the backbone network, downsampling is performed level by level through stride convolution and pooling layers. Feature extraction is performed after each downsampling process, resulting in multiple original feature maps at different scales: a deep feature map c3, a mid-level feature map c2, and a shallow feature map c1, ordered from largest to smallest scale.
[0165] Step S904: Perform bidirectional feature fusion from top to bottom and from bottom to top on the original feature maps of multiple different scales to obtain fused feature tensors at multiple different scales.
[0166] Step S906: Fuse multiple fusion feature tensors at different scales and perform convolution processing to obtain target feature data in the raster map.
[0167] For example, such as Figure 10As shown, the multi-scale feature bidirectional fusion pyramid module 1004 performs the following operations: The top-down fusion process includes: first, resizing the deep feature map c3 to scale its resolution to the resolution of the mid-level feature map c2; then, performing a parallel operation between the feature map enlarged from the deep feature map c3 and the original mid-level feature map c2 to obtain the first mid-level fusion feature tensor c21. Next, resizing the first mid-level fusion feature tensor c21 to scale its resolution to the resolution of the shallow feature map c1; then, performing a parallel operation between the feature tensor enlarged from the first mid-level fusion feature tensor c21 and the original shallow feature map c1 to obtain the shallow fusion feature tensor c11.
[0168] The bottom-up fusion process includes: resizing the original shallow feature map c1 to scale its resolution to the resolution of the first intermediate-layer fusion feature tensor c21; then performing a parallel operation between the reduced feature map c1 and the first intermediate-layer fusion feature tensor c21 to obtain the second intermediate-layer fusion feature tensor c23. Resizing the second intermediate-layer fusion feature tensor c23 to scale its resolution to the resolution of the original deep feature map c3; then performing a parallel operation between the reduced feature tensor c23 and the deep feature map c3 to obtain the deep fusion feature tensor c33.
[0169] The deep fusion feature tensor c33, the first mid-layer fusion feature tensor c21, the second mid-layer fusion feature tensor c23, and the shallow fusion feature tensor c11 are fused and convolved to obtain multi-dimensional target feature data of small, medium, and large-sized obstacles in the grid map.
[0170] Step S908: Based on the target feature data, determine the category recognition result and target bounding box corresponding to each obstacle.
[0171] For example, the detection box branch 61 of the detection prediction module 1006 can be used to regress and calculate the bounding box coordinates, length, width, and confidence of each obstacle in the raster map based on the target feature data, and finally output the target bounding box of each obstacle. The category branch 63 of the detection prediction module 1006 can be used to classify and identify the detected obstacles based on the target feature data, and finally output the category identification result of each obstacle.
[0172] Optionally, in some implementations, the direction angle of the obstacle can also be output using the detection frame branch. Subsequently, during the execution of step S108, for obstacles near the wall, their direction angle can be oriented towards the direction away from the wall.
[0173] In this embodiment, a target detection model is designed based on a deep learning network and adopted using a feature pyramid approach. The grid map is converted into different sizes, and multi-scale feature extraction is performed on multi-layer images. This model can adapt to obstacles of different sizes, including large, medium, and small obstacles. By merging features from different layers, the detection capability of small targets is enhanced, thereby improving the accuracy of category recognition results and target bounding boxes, and reducing the probability of missed detections and false detections.
[0174] In one exemplary embodiment, such as Figure 11 As shown, a method for training an object detection model is also provided, including the following steps S1102 to S1108. Wherein:
[0175] Step S1102: Obtain raster map samples as training data, use the category annotation data corresponding to the raster map samples as category labels, and use the bounding box annotation data corresponding to the raster map samples as bounding box labels.
[0176] The category labeling data can be used to describe the categories of obstacles in the raster map sample. Optionally, in some implementations, the labeled categories may include, but are not limited to, sofa categories, table categories, bed categories, bedside table categories, TV cabinet categories, coffee table categories, cabinet categories, chair categories, etc.
[0177] Bounding box annotation data can be used to describe the areas where obstacles are located in a raster map sample. Optionally, in other embodiments, the bounding box annotation data may also include orientation angle data.
[0178] For example, two-dimensional raster map data containing obstacle outlines collected in a real-world scene can be acquired. A preset image processing algorithm is then used to process the two-dimensional raster map data to filter for higher-resolution raster points, correct raster distortion, and remove noise, thereby obtaining a result such as... Figure 12 The image shows the raster map sample data to be labeled. Obtain the category labeling data and bounding box labeling data for the raster map sample. Use the category labeling data corresponding to the raster map sample as the category labels, and the bounding box labeling data corresponding to the raster map sample as the bounding box labels. Figure 12 The raster map sample data is labeled to form Figure 13 The raster map sample shown is used as training data. Figure 13 Different colored bounding boxes in the text correspond to different categories.
[0179] Step S1104: Perform weak data augmentation and strong data augmentation on the training data respectively.
[0180] For example, weak data augmentation and strong data augmentation can be performed on the same training data separately to obtain weakly augmented training data and strongly augmented training data. Weak data augmentation can be achieved through random resampling or horizontal flipping. Strong data augmentation can be achieved through multi-image stitching, image blending, or random rotation and cropping.
[0181] Step S1106: Input the weakly augmented training data into the teacher network to obtain the category prediction results and bounding box prediction results.
[0182] For example, the teacher network can be determined based on any of the following model network architectures: single-stage real-time detection model (such as YOLO model, SSD model, etc.), two-stage high-precision detection model (such as Faster R-CNN model, Mask R-CNN model, etc.), end-to-end detection model, etc. The training data after weak data augmentation is input into the teacher network to detect and identify categories and bounding boxes, and the category prediction results and bounding box prediction results output by the teacher network are obtained.
[0183] Step S1108: Input the training data after strong data augmentation into the student network and combine it with the category prediction results, bounding box prediction results, category labels and bounding box labels to train the student network. The trained student network is then used as the object detection model.
[0184] For example, a student network can be based on Figure 10 The model network architecture was determined. The heavily augmented training data was input into the student network for prediction. The loss function of the student network's predictions was calculated by combining the class and bounding box predictions from the teacher network with the class and bounding box labels corresponding to the training data. The adjustable parameters in the student network were iteratively adjusted based on the loss function until the adjusted student network's loss function converged to its minimum value, at which point training ended. The trained student network was then used as the object detection model.
[0185] Alternatively, in some implementations, the loss function of the student network during training can be calculated in the following manner:
[0186] ,
[0187] in, It is the value of the loss function. , as well as This represents the adjustable parameters in the student network. This represents the classification cost of the student network. This represents the cost of student network reconnection. This can represent the regional prior cost of a student network.
[0188] Optionally, in some implementations, the classification cost can be obtained by separately calculating the difference between the category predictions output by the teacher network and the category predictions by the student network, and the difference between the actual category label and the category predictions by the student network, and then adding the first two differences together.
[0189] Optionally, in some implementations, the regression cost can be obtained by separately calculating the positional difference between the bounding box prediction results output by the teacher network and the bounding box predicted by the student network, and the positional difference between the actual bounding box label and the bounding box predicted by the student network, and then adding the first two differences together.
[0190] Optionally, in some implementations, the intersection-union ratio (IU) between the actual bounding box labels and the prior boxes configured by the student network itself can be calculated, and positive and negative samples can be divided according to the IU to generate a true matching label corresponding to each prior box. During the student network prediction process, a prediction confidence score is output for each prior box to determine whether it hits an obstacle, and the region prior cost is calculated using the prediction confidence score and the true matching label.
[0191] In this embodiment, by performing weak and strong data augmentation on the training data respectively, and using teacher and student networks for supervised training, a target detection model is obtained. This model can not only improve the generalization ability of the network by using strong data augmentation to adapt to different terrain shapes, but also avoid network overfitting by using weak data augmentation. Ultimately, this enables the student network to better learn the mapping relationship between the grid map, category labels, and bounding box labels.
[0192] This application, through the visualization map generation method provided in the above embodiments, can directly predict obstacle positions based on the geometric features of a grid map using an object detection model, avoiding 2D image conversion errors and improving the accuracy of obstacle recognition. By using an object detection model based on multi-scale feature fusion to extract target feature data from the grid map and combining prior knowledge to post-process and correct the recognition results output by the object detection model, it can not only reduce the probability of missed and false detections of obstacles and enhance the completeness of obstacle recognition, but also improve the rationality of the layout of each obstacle after correction by using semantic constraints, making the reconstructed visualization map more consistent with the real scene. Furthermore, this application uses an object detection model for end-to-end online processing, adapting to embedded devices, eliminating the need for offline storage and computation, reducing computing power requirements, reducing latency, improving reconstruction efficiency, and enabling a lightweight design. Moreover, since this application only requires a grid map and does not rely on a visual sensor, it is compatible with most cleaning robot models and has a wide range of applications.
[0193] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0194] Based on the same inventive concept, this application also provides a visualization map generation apparatus for implementing the visualization map generation method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more visualization map generation apparatus embodiments provided below can be found in the limitations of the visualization map generation method described above, and will not be repeated here.
[0195] In one exemplary embodiment, a visual map generation device is provided, comprising: a map acquisition module, an obstacle recognition module, and a map generation module, wherein:
[0196] The map acquisition module is used to acquire a raster map, which includes impassable and traversable rasters.
[0197] The obstacle recognition module is used to determine the category recognition result and target bounding box of obstacles in the grid map based on the impassable and passable grids in the grid map.
[0198] The map generation module is used to generate visual obstacles in a visual map based on the obstacle category identification results and the target bounding box.
[0199] In an exemplary embodiment, the obstacle recognition module includes a model detection unit, used to extract features of impassable and drivable grids using a target detection model, and to identify obstacles in the grid map based on the extracted features, determining the obstacle category recognition result and the target bounding box; and a recognition correction unit, used to correct the category recognition result and / or the target bounding box by combining preset prior knowledge, including semantic constraints and / or geometric constraints. The map generation module is further used to determine the corresponding position of the corrected target bounding box mapped to the visualized map based on the coordinate transformation relationship between the grid map and the visualized map, and to add object identifiers corresponding to the corrected category recognition result at the corresponding positions to form visualized obstacles.
[0200] In an exemplary embodiment, the prior knowledge includes geometric constraints. The identification correction unit is further configured to determine the exterior wall region based on impassable and traversable grids in the grid map; determine the area ratio of the target bounding box that exceeds the exterior wall region; and, in response to the area ratio being greater than a preset threshold in the geometric constraints, delete the category identification result and the target bounding box of the corresponding obstacle to obtain the corrected category identification result and the corrected target bounding box.
[0201] In an exemplary embodiment, the prior knowledge includes geometric constraints. The identification and correction unit is further configured to determine the inner wall region based on impassable and traversable grids in the grid map; if the target bounding box crosses the inner wall region, determine a first area of the target bounding box on one side of the inner wall region and a second area on the other side of the inner wall region; if the first area is greater than the second area, move the target bounding box to the side corresponding to the first area based on the geometric constraints to obtain the corrected target bounding box.
[0202] In an exemplary embodiment, the prior knowledge also includes semantic constraints. The identification correction unit is further configured to, when the first area equals the second area, determine the target region type corresponding to the obstacle's category identification result based on the semantic mapping relationship between the region type and the object category in the semantic constraints; and move the obstacle's target bounding box to the side that matches the target region type based on the semantic constraints to obtain the corrected target bounding box.
[0203] In an exemplary embodiment, the prior knowledge includes semantic constraints. The identification and correction unit is further configured to determine the region type of the area where the target bounding box of the obstacle is located based on the partition information corresponding to the raster map; determine the target object category corresponding to the region type based on the semantic mapping relationship between the region type and the object category in the semantic constraints; and delete the corresponding obstacle category identification result and the target bounding box if the target object category and the obstacle category identification result are different.
[0204] In an exemplary embodiment, the prior knowledge includes semantic constraints. The identification correction unit is further configured to determine, based on the association relationship between object categories in the semantic constraints, the associated category corresponding to the category identification result of the obstacle, and the object association distance between the category identification result and the associated category; determine the association search range based on the target bounding box of the obstacle and the object association distance, and search for other obstacles within the association search range; if no other obstacles under the associated category are found within the association search range, and if other obstacles belonging to a preset category similar to the associated category exist within the association search range, the category identification result of the other obstacles is corrected to the associated category, thus obtaining the corrected category identification result of the other obstacles.
[0205] In an exemplary embodiment, the prior knowledge includes semantic constraints. The identification correction unit is further configured to: determine the region type of the area where the target bounding box of the obstacle is located based on the partition information corresponding to the raster map; determine the target region type corresponding to the category identification result of the obstacle based on the semantic mapping relationship between the region type and the object category in the semantic constraints; determine the associated category corresponding to the category identification result of the obstacle based on the association relationship between the object categories in the semantic constraints; search for other obstacles within the object association distance of the target bounding box of the obstacle based on the object association distance of the associated category in the semantic constraints; and, if the region type is consistent with the target region type, and there are other obstacles within the object association distance whose category identification result belongs to the associated category, use the category identification result of the obstacle as the corrected category identification result.
[0206] In an exemplary embodiment, the prior knowledge also includes geometric constraints. The identification correction unit is further configured to: determine a preset category similar to the category identification result of the obstacle based on semantic constraints when the region type is inconsistent with the target region type and / or there are no other obstacles within the object association distance whose category identification results belong to the associated category; determine a preset region type corresponding to the obstacle of the preset category according to the semantic mapping relationship between the region type and the object category in the semantic constraints; determine the object aspect ratio threshold corresponding to the preset category in the geometric constraints; and correct the category identification result of the obstacle to the preset category when the region type is consistent with the preset region type and the aspect ratio of the obstacle is greater than the object aspect ratio threshold, thereby obtaining the corrected category identification result of the obstacle.
[0207] In an exemplary embodiment, the prior knowledge includes semantic constraints. The identification correction unit is further configured to: determine multiple obstacles located in the same area based on the target bounding boxes of the obstacles and the partitioning information of the raster map; determine the distance between multiple obstacles with the same category identification result within the same area; if the distance is less than the distance threshold in the semantic constraints, determine the confidence levels of the first obstacle and the second obstacle corresponding to the distance; if the confidence level of the first obstacle is higher than the confidence level of the second obstacle, use the category identification result and target bounding box of the first obstacle as the corrected category identification result and target bounding box, and delete the category identification result and target bounding box of the second obstacle.
[0208] In an exemplary embodiment, the prior knowledge includes semantic constraints. The identification correction unit is further configured to identify multiple obstacles with the same category identification result and whose target bounding boxes are side by side or adjacent; if the category identification result belongs to a mergeable category in the semantic constraints, the object category corresponding to the number of multiple obstacles is determined as the corrected category identification result based on the number of multiple obstacles and the mapping relationship between the number of objects and the object category in the semantic constraints; the target bounding boxes of the multiple obstacles are merged to obtain the corrected target bounding box.
[0209] In an exemplary embodiment, the prior knowledge includes geometric constraints. The identification correction unit is further configured to, when the obstacle's category identification result is separable, determine the aspect ratio of the obstacle based on the obstacle's target bounding box; and, based on the obstacle's category identification result, the obstacle's aspect ratio, and the mapping relationship between the aspect ratio and sub-categories in the geometric constraints, determine the sub-category corresponding to the obstacle's aspect ratio as the corrected category identification result.
[0210] In an exemplary embodiment, the prior knowledge includes geometric constraints. The identification and correction unit is further configured to: determine the size parameters of the obstacle based on the target bounding box of the obstacle; determine the preset size parameters corresponding to the category identification result of the obstacle based on the preset mapping relationship between object categories and object sizes in the geometric constraints; and correct the target bounding box of the obstacle based on the preset size parameters if the size parameters are inconsistent with the preset size parameters, thereby obtaining the corrected target bounding box.
[0211] In an exemplary embodiment, the model detection unit is further configured to input a grid map into a target detection model, and extract features based on impassable and traversable grids during multiple downsampling operations using the backbone network of the target detection model to obtain multiple original feature maps at different scales; sequentially perform bidirectional feature fusion from top to bottom and bottom to top on the multiple original feature maps at different scales to obtain multiple fused feature tensors at different scales; fuse the fused feature tensors at multiple different scales and perform convolution processing to obtain target feature data in the grid map; and determine the category recognition result and target bounding box corresponding to each obstacle based on the target feature data.
[0212] In an exemplary embodiment, the visualization map generation device further includes a model training module, configured to acquire raster map samples as training data, use the category labeling data corresponding to the raster map samples as category labels, and use the bounding box labeling data corresponding to the raster map samples as bounding box labels; perform weak data augmentation and strong data augmentation on the training data respectively; input the weakly augmented training data into the teacher network to obtain category prediction results and bounding box prediction results; input the strongly augmented training data into the student network and combine the category prediction results, bounding box prediction results, category labels, and bounding box labels to train the student network, and use the trained student network as an object detection model.
[0213] Each module in the aforementioned visualization map generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the cleaning robot in hardware form or independent of it, or stored in the memory of the cleaning robot in software form, so that the processor can call and execute the corresponding operations of each module.
[0214] In an exemplary embodiment, a cleaning robot is provided, which can be a terminal. The cleaning robot includes a processor, memory, input / output interface, communication interface, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface and input device are connected to the system bus via the input / output interface. The processor of the cleaning robot provides computing and control capabilities. The memory of the cleaning robot includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The input / output interface of the cleaning robot is used for exchanging information between the processor and external devices. The communication interface of the cleaning robot is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a method for generating a visual map. The input device of the cleaning robot can be buttons, a trackball, or a touchpad mounted on its casing.
[0215] Those skilled in the art will understand that the structures described in the above embodiments are only part of the structures related to the present application and do not constitute a limitation on the cleaning robot to which the present application is applied. A specific cleaning robot may include more or fewer parts than shown in the figure, or combine some parts, or have different part arrangements.
[0216] In one exemplary embodiment, a cleaning robot is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0217] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0218] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0219] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0220] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0221] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for generating a visual map, characterized in that, The method includes: Obtain a raster map, which includes impassable and passable rasters; Based on the impassable and traversable grids in the grid map, determine the category identification results and target bounding boxes of obstacles in the grid map; Based on the obstacle category identification results and the target bounding box, a visual obstacle is generated in the visual map.
2. The method according to claim 1, characterized in that, The step of determining the category identification result and target bounding box of obstacles in the grid map based on the impassable and drivable grids in the grid map includes: The features of the impassable and traversable grids are extracted using an object detection model, and obstacles in the grid map are identified based on the extracted features. The category identification results of the obstacles and the target bounding box are then determined. The category recognition result and / or the target bounding box are corrected by combining preset prior knowledge, wherein the prior knowledge includes semantic constraints and / or geometric constraints. The step of generating visualized obstacles in a visualized map based on the obstacle category identification results and target bounding boxes includes: Based on the coordinate transformation relationship between the grid map and the visualization map, the corrected target bounding box is mapped to the corresponding position on the visualization map, and an object identifier corresponding to the corrected category recognition result is added at the corresponding position to form the visualization obstacle.
3. The method according to claim 2, characterized in that, When the prior knowledge includes geometric constraints, the category recognition result and the target bounding box are corrected by combining preset prior knowledge, including: Based on the impassable and passable grids in the grid map, the external wall area is determined; Determine the proportion of the area of the target bounding box that extends beyond the outer wall region; In response to the area ratio being greater than a preset threshold in the geometric constraints, the category recognition result and target bounding box of the corresponding obstacle are deleted to obtain the corrected category recognition result and the corrected target bounding box.
4. The method according to claim 2, characterized in that, When the prior knowledge includes geometric constraints, the target bounding box is corrected by incorporating preset prior knowledge, including: Based on the impassable and passable grids in the grid map, the interior wall area is determined; When the target bounding box crosses the inner wall region, determine a first area of the target bounding box on one side of the inner wall region and a second area on the other side of the inner wall region; If the first area is larger than the second area, the target bounding box is moved to the side corresponding to the first area based on the geometric constraints to obtain the corrected target bounding box.
5. The method according to claim 4, characterized in that, If the prior knowledge also includes semantic constraints, the method further includes: When the first area is equal to the second area, the target region type corresponding to the obstacle category recognition result is determined according to the semantic mapping relationship between the region type and the object category in the semantic constraints. Based on the semantic constraints, the target bounding box of the obstacle is moved to the side that matches the target region type to obtain the corrected target bounding box.
6. The method according to claim 2, characterized in that, When the prior knowledge includes semantic constraints, the category recognition result and the target bounding box are corrected by combining preset prior knowledge, including: Based on the partition information corresponding to the grid map, determine the region type of the area where the target bounding box of the obstacle is located; Based on the semantic mapping relationship between region type and object category in the semantic constraints, determine the target object category corresponding to the region type; If the category of the target object differs from the category recognition result of the obstacle, delete the category recognition result of the corresponding obstacle and the target bounding box.
7. The method according to claim 2, characterized in that, When the prior knowledge includes semantic constraints, the category recognition result is corrected by incorporating preset prior knowledge, including: Based on the association between object categories in the semantic constraints, determine the associated category corresponding to the category recognition result of the obstacle, and the object association distance between the category recognition result and the associated category; The associated search range is determined based on the target bounding box of the obstacle and the associated distance of the object, and other obstacles are searched within the associated search range. If no other obstacles under the associated category are found within the associated search range, and if other obstacles belonging to a preset category similar to the associated category exist within the associated search range, the category identification result of the other obstacles is corrected to the associated category, thus obtaining the corrected category identification result of the other obstacles.
8. The method according to claim 2, characterized in that, When the prior knowledge includes semantic constraints, the category recognition result is corrected by incorporating preset prior knowledge, including: Based on the partition information corresponding to the grid map, determine the region type of the area where the target bounding box of the obstacle is located; Based on the semantic mapping relationship between region type and object category in the semantic constraints, determine the target region type corresponding to the obstacle category recognition result; Based on the association between object categories in the semantic constraints, determine the associated category corresponding to the category recognition result of the obstacle; Based on the object association distance corresponding to the association category in the semantic constraints, search for other obstacles whose target bounding boxes are within the object association distance of the obstacle; If the region type is consistent with the target region type, and if there are other obstacles within the object association distance whose category identification results belong to the associated category, the category identification results of the obstacles shall be used as the corrected category identification results.
9. The method according to claim 8, characterized in that, The prior knowledge also includes geometric constraints. The method further includes: If the region type is inconsistent with the target region type, and / or there are no other obstacles within the object association distance whose category identification results belong to the associated category, a preset category similar to the category identification results of the obstacle is determined based on the semantic constraints. Based on the semantic mapping relationship between region type and object category in the semantic constraints, determine the preset region type corresponding to the preset category of obstacle; Determine the aspect ratio threshold of the object corresponding to the preset category in the geometric constraints; If the region type is consistent with the preset region type and the aspect ratio of the obstacle is greater than the aspect ratio threshold of the object, the category recognition result of the obstacle is corrected to the preset category to obtain the corrected category recognition result of the obstacle.
10. The method according to claim 2, characterized in that, When the prior knowledge includes semantic constraints, the category recognition result and the target bounding box are corrected by combining preset prior knowledge, including: Based on the target bounding box of the obstacle and the partition information of the grid map, multiple obstacles located in the same area are identified; Within the same area, determine the distance between multiple obstacles with the same category identification result; If the distance is less than the distance threshold in the semantic constraints, determine the confidence levels of the first obstacle and the second obstacle corresponding to the distance. If the confidence level of the first obstacle is higher than that of the second obstacle, the category identification result and target bounding box of the first obstacle are used as the corrected category identification result and target bounding box, and the category identification result and target bounding box of the second obstacle are deleted.
11. The method according to claim 2, characterized in that, When the prior knowledge includes semantic constraints, the category recognition result and the target bounding box are corrected by combining preset prior knowledge, including: Identify multiple obstacles with the same category recognition result and whose target bounding boxes are side by side or adjacent to each other; If the category recognition result belongs to a mergeable category in the semantic constraints, the object category corresponding to the number of the multiple obstacles is determined based on the number of the multiple obstacles and the mapping relationship between the number of objects and the object category in the semantic constraints, and is used as the corrected category recognition result. The target bounding boxes of the multiple obstacles are merged to obtain the corrected target bounding box.
12. The method according to claim 2, characterized in that, When the prior knowledge includes geometric constraints, the category recognition result is corrected by incorporating preset prior knowledge, including: If the obstacle's category identification result is classified as separable, the aspect ratio of the obstacle is determined based on the obstacle's target bounding box. Based on the obstacle category identification result, the obstacle's aspect ratio, and the mapping relationship between the aspect ratio and sub-category in the geometric constraints, the sub-category corresponding to the obstacle's aspect ratio is determined as the corrected category identification result.
13. The method according to claim 2, characterized in that, When the prior knowledge includes geometric constraints, the target bounding box is corrected by incorporating preset prior knowledge, including: Based on the target bounding box of the obstacle, determine the size parameters of the obstacle; Based on the mapping relationship between the object category and the object size in the geometric constraints, determine the preset size parameters corresponding to the obstacle category recognition result; If the size parameter is inconsistent with the preset size parameter, the target bounding box of the obstacle is corrected according to the preset size parameter to obtain the corrected target bounding box.
14. The method according to claim 2, characterized in that, The step of extracting features from the impassable and drivable grids using a target detection model, identifying obstacles in the grid map based on the extracted features, and determining the category identification result of the obstacle and the target bounding box includes: The grid map is input into the target detection model, and the backbone network of the target detection model is used to perform multiple downsampling operations to extract features based on the impassable grid and the passable grid, resulting in multiple original feature maps of different scales. Bidirectional feature fusion, both top-down and bottom-up, is performed sequentially on the original feature maps at multiple different scales to obtain the fused feature tensors at the multiple different scales. The target feature data in the grid map is obtained by fusing the fusion feature tensors at multiple different scales and performing convolution processing. Based on the target feature data, the category recognition result and target bounding box corresponding to each obstacle are determined.
15. The method according to claim 2, characterized in that, The training methods for the object detection model include: Obtain raster map samples as training data, use the category annotation data corresponding to the raster map samples as category labels, and use the bounding box annotation data corresponding to the raster map samples as bounding box labels; Weak data augmentation and strong data augmentation are performed on the training data respectively; The training data after weak data augmentation is input into the teacher network to obtain the category prediction results and bounding box prediction results. The training data after strong data augmentation is input into the student network and combined with the category prediction results, the bounding box prediction results, the category labels, and the bounding box labels to train the student network. The trained student network is then used as the object detection model.
16. A visualization map generation device, characterized in that, The device includes: A map acquisition module is used to acquire a raster map, which includes impassable and traversable rasters. An obstacle recognition module is used to determine the category recognition result and target bounding box of obstacles in the grid map based on the impassable and passable grids in the grid map; The map generation module is used to generate visual obstacles in a visual map based on the obstacle category identification results and the target bounding box.
17. A cleaning robot, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 15.
18. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 15.
19. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 15.
