A real-time environment semantic perception method, device, equipment and medium

Through the real-time environment semantic perception method, the improved RepViT-M1.1 module is used for lawn identification and adaptive mowing, which solves the problems of time-consuming, tiring and high maintenance costs of traditional lawn mowers, and achieves efficient and economical lawn maintenance.

CN118364732BActive Publication Date: 2024-09-13CHENGDU AJIAXI INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410798259.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-09-13
Estimated Expiration
2044-06-20

AI Technical Summary

Technical Problem

Traditional lawn mowers are time-consuming, tiring, inefficient, have high maintenance costs, have an impact on the environment, are difficult to operate in narrow or complex environments, and are complex to operate and maintain.

Method used

The real-time environment semantic perception method is used to carry out lawn recognition and adaptive pruning through the image segmentation model (based on the improved RepViT-M1.1 module), and the image acquisition unit, segmented image acquisition unit and lawn pruning determination unit are used to realize automatic lawn mowing.

Benefits of technology

It improves the efficiency and accuracy of lawn maintenance, reduces costs, enhances safety and environmental adaptability, and provides cost-effective lawn maintenance solutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118364732B
    Figure CN118364732B
Patent Text Reader

Abstract

The present application discloses a real-time environment semantic perception method, device, equipment and medium, which relates to the field of machine vision technology and is used to solve the problem that the existing technology cannot provide an economical and efficient lawn maintenance solution. The method comprises: real-time image acquisition of the current environment to obtain the original acquired image; inputting the original acquired image into a trained image segmentation model to obtain a target segmented image; wherein the trained image segmentation model is obtained based on an improved RepViT‑M1.1 module; and determining whether to adaptively mow the lawn according to the category of the target segmented image. The target segmented image is obtained by using the trained image segmentation model obtained based on the improved RepViT‑M1.1 module, thereby greatly improving the environmental perception capability, improving the image segmentation accuracy and efficiency, and providing a lawn maintenance solution that is both economical and efficient for the majority of users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of machine vision technology and provides a real-time environment semantic perception method, device, equipment and medium. Background Art

[0002] As people's living standards improve, lawn culture has gradually entered the public eye. A green and well-manicured lawn is not only a family pride, but also a symbol of social status. Therefore, lawn maintenance and beautification have gradually become an important part of people's daily lives. In order to keep the lawn in perfect condition, many families need to mow the lawn several times a month.

[0003] In traditional mowing methods, push-type and riding mowers are often used for mowing. However, traditional push-type mowers have the following disadvantages: (1) Since users need to push the mower to mow the grass, it is very time-consuming and tiring; (2) Since it relies on manual push, the work efficiency is relatively low; (3) Since the operator's experience and skills will directly affect the quality of mowing, it is easy to have uneven mowing; (4) It performs poorly when dealing with terrain with large slopes, and its operation in narrow spaces is limited; (5) It requires regular maintenance such as blade replacement and oil replacement, so the maintenance cost is high. Traditional riding mowers have the following disadvantages: (1) It is expensive and not economical; (2) It is large in size and not easy to operate in narrow or complex environments, requiring a large storage space; (3) It consumes a lot of fuel or electricity during use; (4) The operation and maintenance are relatively complicated, requiring professional knowledge and skills; (5) Due to the high fuel consumption, it will have a certain impact on the environment.

[0004] Therefore, how to provide users with an economical and efficient lawn maintenance solution has become an urgent problem to be solved. Summary of the invention

[0005] The present application provides a real-time environment semantic perception method, device, equipment and medium, which are used to solve the problem that the existing technology cannot provide an economical and efficient lawn maintenance solution.

[0006] On the one hand, a real-time environment semantic perception method is provided, which is applied to an automatic lawn mower scenario, and the method comprises:

[0007] Perform real-time image acquisition of the current environment to obtain the original acquired image;

[0008] Inputting the original acquired image into a trained image segmentation model to obtain a target segmented image; wherein the trained image segmentation model is obtained based on an improved RepViT-M1.1 module, and the improved RepViT-M1.1 module performs weighted summation on two feature maps obtained by splitting the feature map of the original acquired image and dynamic weights obtained based on a fully connected network and a softmax operation to obtain a first feature map;

[0009] Whether to perform adaptive mowing on the lawn is determined according to the category of the target segmented image.

[0010] Optionally, the step of inputting the original acquired image into a trained image segmentation model to obtain a target segmented image includes:

[0011] The original collected image is sequentially input into the first four stages of the trained image segmentation model for downsampling to obtain feature maps of 1 / 16 and 1 / 32 sizes;

[0012] Inputting the 1 / 32 size feature map into the fifth stage of the trained image segmentation model for processing to obtain the first feature map; wherein the fifth stage includes an improved RepViT-M1.1 module;

[0013] Using an attention module, respectively perform feature enhancement on the feature map of size 1 / 16, the feature map of size 1 / 32, and the first feature map to obtain feature maps of three different scales;

[0014] Using a multi-scale feature fusion module, the feature maps of the three different scales are fused to obtain a fused feature map;

[0015] The segmentation head is used to upsample the fused feature map to obtain the target segmentation image.

[0016] Optionally, the step of inputting the feature map of size 1 / 32 into the fifth stage of the trained image segmentation model for processing to obtain the first feature map includes:

[0017] According to a preset splitting ratio, the 1 / 32 size feature map is split into a second feature map and a third feature map; wherein the second feature map is a characterization feature map for extracting richer feature information; and the third feature map is used to define redundancy;

[0018] Performing 3×3 convolution on the second feature map to extract features, to obtain a fifth feature map;

[0019] Performing 1×1 convolution on the third feature map to extract features, to obtain a sixth feature map;

[0020] Splicing the fifth feature map and the sixth feature map to obtain a spliced ​​feature map;

[0021] The concatenated feature map is processed using a fully connected network and a softmax operation to obtain dynamic weights corresponding to the fifth feature map and the sixth feature map respectively;

[0022] A weighted sum is performed on the fifth feature map, the sixth feature map, and the dynamic weights corresponding to the fifth feature map and the sixth feature map, respectively, to obtain the first feature map.

[0023] Optionally, the step of processing the concatenated feature map using a fully connected network and a softmax operation to obtain dynamic weights corresponding to the fifth feature map and the sixth feature map respectively includes:

[0024] Using global average pooling to extract high-level information from the concatenated feature map to obtain a seventh feature map;

[0025] The seventh feature map is processed by using a fully connected network and a softmax operation to obtain dynamic weights corresponding to the fifth feature map and the sixth feature map.

[0026] Optionally, before inputting the original captured image into a trained image segmentation model to obtain a target segmented image, the method further includes:

[0027] According to preset categories, multiple samples in a preset public data set are classified to obtain a first data set; wherein the categories include grass, trees, people, animals, roads, land, water bodies, vehicles and equipment, and others;

[0028] Capturing images of different actual lawn scenes to obtain a second data set including a plurality of actual samples;

[0029] A lawn segmentation dataset is obtained according to the first dataset and the second dataset.

[0030] Optionally, after obtaining a lawn segmentation dataset according to the first dataset and the second dataset, the method further includes:

[0031] Performing data enhancement operations on multiple samples in the lawn segmentation data set to obtain a data-enhanced data set; wherein the data enhancement operations include random rotation, scaling, translation, flipping, brightness adjustment, and color transformation;

[0032] For categories with fewer samples in the data set after data enhancement, background replacement is used to increase the number of samples in the category.

[0033] Optionally, before inputting the original captured image into a trained image segmentation model to obtain a target segmented image, the method further includes:

[0034] According to the lawn segmentation data set, the initial image segmentation model is trained by adopting a multi-machine multi-card acceleration method to obtain a trained image segmentation model; wherein the multi-machine multi-card acceleration method is a multi-process distributed parallel method.

[0035] On the one hand, a real-time environment semantic perception device is provided, which is applied to an automatic lawn mower scene, and the device comprises:

[0036] An image acquisition unit is used to acquire real-time images of the current environment and obtain original acquired images;

[0037] A segmented image obtaining unit, used for inputting the original acquired image into a trained image segmentation model to obtain a target segmented image; wherein the trained image segmentation model is obtained based on an improved RepViT-M1.1 module, and the improved RepViT-M1.1 module performs a weighted sum of two feature maps obtained by splitting the feature map of the original acquired image and a dynamic weight obtained based on a fully connected network and a softmax operation to obtain a first feature map;

[0038] The lawn mowing determination unit is used to determine whether to perform adaptive mowing on the lawn according to the category of the target segmented image.

[0039] On the one hand, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein any one of the above methods is implemented when the processor executes the computer program.

[0040] In one aspect, a computer storage medium is provided, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, any of the above methods is implemented.

[0041] Compared with the prior art, the beneficial effects of this application are:

[0042] In an embodiment of the present application, when identifying and adaptively mowing a lawn, first, real-time image acquisition of the current environment can be performed to obtain an original acquired image; then, the original acquired image can be input into a trained image segmentation model to obtain a target segmented image; wherein the trained image segmentation model is obtained based on an improved RepViT-M1.1 module, and the improved RepViT-M1.1 module performs weighted sum of two feature maps obtained by splitting the feature map of the original acquired image and dynamic weights obtained based on a fully connected network and a softmax operation to obtain a first feature map; finally, whether to adaptively mow the lawn can be determined based on the category of the target segmented image. Therefore, in the embodiment of the present application, since the target segmentation image is directly obtained according to the trained image segmentation model, and the trained image segmentation model is obtained based on the improved RepViT-M1.1 module, that is, compared with the prior art, the improved real-time environmental semantic perception method applied to the automatic lawn mower scene proposed in the present application can improve the image segmentation accuracy and efficiency by greatly improving the environmental perception ability, thereby optimizing the user interaction experience, reducing product costs, enhancing safety and environmental adaptability, and improving mowing efficiency, providing users with a lawn maintenance solution that is both economical and efficient. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0044] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;

[0045] Figure 2 A flowchart of a real-time environment semantic perception method provided in an embodiment of the present application;

[0046] Figure 3 A schematic diagram of the structure of a trained image segmentation model provided in an embodiment of the present application;

[0047] Figure 4 A structural schematic diagram of an improved RepViT-M1.1 module provided in an embodiment of the present application;

[0048] Figure 5 A schematic diagram of a flow chart of the overall technical solution provided in the embodiment of the present application;

[0049] Figure 6A schematic diagram of a real-time environmental semantic perception device provided in an embodiment of the present application.

[0050] Markings in the figure: 10-real-time environment semantic perception device, 101-processor, 102-memory, 103-I / O interface, 104-database, 60-real-time environment semantic perception device, 601-image acquisition unit, 602-segmented image acquisition unit, 603-lawn mowing determination unit, 604-dataset acquisition unit, 605-dataset processing unit, 606-model training unit. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be arbitrarily combined with each other. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.

[0052] As people's living standards improve, lawn culture has gradually entered the public eye. A green and well-manicured lawn is not only a family pride, but also a symbol of social status. Therefore, lawn maintenance and beautification have gradually become an important part of people's daily lives. In order to keep the lawn in perfect condition, many families need to mow the lawn several times a month.

[0053] In traditional mowing methods, push-type and riding mowers are often used for mowing. However, traditional push-type mowers have the following disadvantages: (1) Since users need to push the mower to mow the grass, it is very time-consuming and tiring; (2) Since it relies on manual push, the work efficiency is relatively low; (3) Since the operator's experience and skills will directly affect the quality of mowing, it is easy to have uneven mowing; (4) It performs poorly when dealing with terrain with large slopes, and its operation in narrow spaces is limited; (5) It requires regular maintenance such as blade replacement and oil replacement, so the maintenance cost is high. Traditional riding mowers have the following disadvantages: (1) It is expensive and not economical; (2) It is large in size and not easy to operate in narrow or complex environments, requiring a large storage space; (3) It consumes a lot of fuel or electricity during use; (4) The operation and maintenance are relatively complicated, requiring professional knowledge and skills; (5) Due to the high fuel consumption, it will have a certain impact on the environment.

[0054] Based on this, an embodiment of the present application provides a real-time environmental semantic perception method, in which, first, real-time image acquisition of the current environment can be performed to obtain an original acquired image; then, the original acquired image can be input into a trained image segmentation model to obtain a target segmented image; wherein the trained image segmentation model is obtained based on an improved RepViT-M1.1 module, and the improved RepViT-M1.1 module performs weighted sum of two feature maps obtained by splitting the feature map of the original acquired image and dynamic weights obtained based on a fully connected network and a softmax operation to obtain a first feature map; finally, whether to adaptively mow the lawn can be determined based on the category of the target segmented image. Therefore, in the embodiment of the present application, since the target segmentation image is directly obtained according to the trained image segmentation model, and the trained image segmentation model is obtained based on the improved RepViT-M1.1 module, that is, compared with the prior art, the improved real-time environmental semantic perception method applied to the automatic lawn mower scene proposed in the present application can improve the image segmentation accuracy and efficiency by greatly improving the environmental perception ability, thereby optimizing the user interaction experience, reducing product costs, enhancing safety and environmental adaptability, and improving mowing efficiency, providing users with a lawn maintenance solution that is both economical and efficient.

[0055] After introducing the design ideas of the embodiments of the present application, the following briefly introduces the application scenarios to which the technical solutions of the embodiments of the present application can be applied. It should be noted that the application scenarios introduced below are only used to illustrate the embodiments of the present application and are not limited. In the specific implementation process, the technical solutions provided by the embodiments of the present application can be flexibly applied according to actual needs.

[0056] like Figure 1 FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the present application. The application scenario may include a real-time environment semantic perception device 10 .

[0057] The real-time environment semantic perception device 10 can be used to identify lawns, for example, it can be a personal computer (PC), a server and a laptop. The real-time environment semantic perception device 10 may include one or more processors 101, a memory 102, an I / O interface 103 and a database 104. Specifically, the processor 101 may be a central processing unit (CPU), or a digital processing unit, etc. The memory 102 may be a volatile memory, such as a random-access memory (RAM); the memory 102 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or the memory 102 is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 102 may be a combination of the above memories. The memory 102 may store some program instructions of the real-time environment semantic perception method provided in the embodiment of the present application, and these program instructions can be used to implement the steps of the real-time environment semantic perception method provided in the embodiment of the present application when executed by the processor 101, so as to solve the problem that the prior art cannot provide an economical and efficient lawn maintenance solution. The database 104 may be used to store data such as the original captured image, the trained image segmentation model, the target segmentation image, the fused feature map, the first feature map, the second feature map, the third feature map, the preset public data set, and the first data set involved in the solution provided in the embodiment of the present application.

[0058] In the embodiment of the present application, the real-time environment semantic perception device 10 can obtain the original captured image through the I / O interface 103, and then the processor 101 of the real-time environment semantic perception device 10 will provide a lawn maintenance solution that is both economical and efficient for the majority of users according to the program instructions of the real-time environment semantic perception method provided in the embodiment of the present application in the memory 102. In addition, the original captured image, the trained image segmentation model, the target segmentation image, the fused feature map, the first feature map, the second feature map, the third feature map, the preset public data set, and the first data set can also be stored in the database 104.

[0059] Of course, the method provided in the embodiment of the present application is not limited to Figure 1 The application scenarios shown can also be used in other possible application scenarios, and the embodiments of the present application are not limited thereto. Figure 1The functions that can be realized by each device in the application scenario shown will be described in the subsequent method embodiments, and will not be described in detail here. Below, the method of the embodiment of the present application will be introduced in conjunction with the accompanying drawings.

[0060] like Figure 2 As shown, it is a flow chart of a real-time environment semantic perception method provided by an embodiment of the present application. The method is applied to an automatic lawn mower scene and can be realized by Figure 1 The real-time environment semantic perception device 10 is used to execute, and specifically, the process of the method is introduced as follows.

[0061] Step 201: Real-time image acquisition of the current environment is performed to obtain an original acquired image.

[0062] In order to enable the automatic lawn mower to accurately identify, classify and adaptively mow the lawn, in an embodiment of the present application, an image acquisition device can be installed on the automatic lawn mower. Then, when the automatic lawn mower performs adaptive mowing, the image acquisition device can be used to perform real-time image acquisition of the current environment to obtain the original captured image.

[0063] Step 202: Input the original captured image into the trained image segmentation model to obtain a target segmented image.

[0064] In an embodiment of the present application, the trained image segmentation model can be obtained based on the improved RepViT-M1.1 module, and the improved RepViT-M1.1 module will obtain two feature maps obtained by splitting the feature map of the original captured image, and perform weighted sum with the dynamic weights obtained based on the fully connected network and softmax operation to obtain a first feature map.

[0065] Specifically, Figure 3 , which is a structural schematic diagram of a trained image segmentation model provided in an embodiment of the present application. The trained image segmentation model is a real-time segmentation network used for an automatic lawn mower (mobile device). The trained image segmentation model adopts an improved RepViT-M1.1 module ( Figure 3 The stage5 in the image segmentation model is used as an important part of the backbone network, so that the trained image segmentation model can maintain a low parameter amount while maintaining high detection accuracy.

[0066] like Figure 3As shown in the figure, the backbone network is mainly divided into five stages. The first stage (stage1) can obtain a feature map that is downsampled four times. The three middle stages (stage2, stage3 and stage4) can downsample by two times in turn, so that a feature map of 1 / 32 size can be obtained after the fourth stage. The fifth stage is the improved RepViT-M1.1 module, which can further balance the speed and accuracy of the trained image segmentation model.

[0067] Furthermore, if Figure 3 As shown in the figure, when the original acquired image is input into the trained image segmentation model to obtain the target segmented image, first, the original acquired image can be sequentially input into the first four stages of the trained image segmentation model for downsampling to obtain feature maps of 1 / 4, 1 / 8, 1 / 16 and 1 / 32 sizes respectively; then, the feature map of 1 / 32 size can be input into the fifth stage of the trained image segmentation model for processing to obtain the first feature map; wherein the fifth stage includes an improved RepViT-M1.1 module, that is, the feature map of 1 / 32 size can be input into the improved RepViT-M1.1 module to obtain the first feature map; next, the attention module can be used to perform feature enhancement on the feature map of 1 / 16 size, the feature map of 1 / 32 size and the first feature map respectively to obtain feature maps of 3 different scales, that is, the attention module can be used to perform feature enhancement on the feature maps generated in the last three stages to obtain feature maps of 3 different scales; then, a multi-scale feature fusion module can be used. module), and perform feature fusion on the three feature maps of different scales to obtain a fused feature map, and the fused feature map is a feature map of 1 / 8 size; finally, the segmentation head can be used to upsample the fused feature map (up, which can be sampled to the original acquired image size) to obtain the target segmented image, that is, to obtain the segmentation result (Segmentation Result).

[0068] Furthermore, when the 1 / 32 size feature map is input into the fifth stage of the trained image segmentation model for processing and the first feature map is obtained, the 1 / 32 size feature map can be firstly split into the second feature map and the third feature map according to the preset splitting ratio; wherein the second feature map is a characterization feature map for extracting richer feature information; and the third feature map is used to define redundancy. Specifically, Figure 4As shown, a structural schematic diagram of the improved RepViT-M1.1 module provided in an embodiment of the present application is shown. First, in order to improve the feature extraction capability of the RepViT-M1.1 module, a feature map of size 1 / 32 can be simultaneously input into 3×3 depth-wise separable convolution (Depth Wise, DW), 3×3DW and 1×1DW to obtain three convolution features respectively, that is, compared with the existing RepViT module, a new 3×3DW is added; then, the three convolution features can be spliced ​​to obtain a spliced ​​feature map.

[0069] Next, in order to solve the problem of increasing parameter quantity, the concatenated feature map can be split (Split), such as Figure 4 As shown in the figure, the split ratio can be controlled by the α parameter, where the second feature map corresponding to the α parameter part is the representative feature map, which is used to extract richer feature information. At the same time, this part can be followed by the "deep separable convolution" to further reduce the number of parameters of the RepViT-M1.1 module. The third feature map corresponding to the (1-α) parameter part is used to define redundancy. This part has a small overall benefit to the RepViT-M1.1 module. Therefore, "point convolution (PW)" can be used to filter out most of the information in order to retain some important features. That is, the second feature map can be subjected to 3×3 convolution (3×3DW) feature extraction to obtain the fifth feature map U a ; The third feature map can be subjected to 1×1 convolution (1×1PW) feature extraction to obtain the sixth feature map U b .

[0070] Then, in order to prevent excessive loss of information, the fifth feature map and the sixth feature map may be concatenated (C) to obtain a concatenated feature map.

[0071] Next, a fully connected (FC) network and a softmax operation can be used to process the concatenated feature map to obtain the dynamic weights corresponding to the fifth feature map and the sixth feature map. Specifically, Figure 4 As shown, global average pooling (GAP) can be used to extract high-level information from the concatenated feature map to obtain the seventh feature map; then, the seventh feature map can be processed using a fully connected network and a softmax operation to obtain the dynamic weights a corresponding to the fifth feature map and the sixth feature map. c and b c .

[0072] Finally, if Figure 4As shown, the fifth feature map, the sixth feature map, and the dynamic weights corresponding to the fifth feature map and the sixth feature map can be weighted and summed to obtain the first feature map. That is, the feature maps of the two branch networks can be combined according to the obtained dynamic weights to obtain the final output. The improved RepViT-M1.1 module of the present application has sufficient flexibility and lightness, and can be easily embedded in the backbone network.

[0073] Step 203: Determine whether to perform adaptive mowing on the lawn according to the category of the target segmented image.

[0074] After obtaining the target segmentation image, in order to be able to respond to the current environment in a timely manner, in the embodiment of the present application, it can be determined whether to perform adaptive mowing of the lawn according to the category of the target segmentation image. Specifically, corresponding strategies can be pre-set for various categories. For example, if the category of the target segmentation image is determined to be lawn, it is determined to perform adaptive mowing of the lawn; if the category of the target segmentation image is determined to be a tree, a person, an animal, a road surface, land, a water body, a vehicle or other, the path of the automatic lawn mower can be re-planned to return the automatic lawn mower to the lawn.

[0075] In a possible implementation, before inputting the original captured image into the trained image segmentation model to obtain the target segmented image, a data set for training the initial image segmentation model may also be acquired.

[0076] Specifically, first, the preset public data sets (for example, coco stuff, Rellis data sets) can be sorted and cleaned; then, multiple samples in the preset public data sets after data cleaning can be classified according to preset categories to obtain a first data set; wherein the categories may include grass, trees, people, animals, roads, land, water, vehicles and equipment, and others (those that are not the eight categories of grass, trees, people, animals, roads, land, water, and vehicles and equipment are set as other categories); next, images of different actual lawn scenes can be collected and annotated in detail to obtain a second data set containing multiple actual samples; finally, a lawn segmentation data set can be obtained based on the first data set and the second data set, that is, the sorted public data set can be combined with the self-collected and sorted data to form a lawn segmentation data set of millions.

[0077] In a possible implementation, after obtaining the lawn segmentation dataset according to the first dataset and the second dataset, in order to increase the accuracy of the data space, data enhancement may be performed on the lawn segmentation dataset. Specifically, data enhancement operations may be performed on multiple samples in the lawn segmentation dataset to obtain a data-enhanced dataset; wherein the data enhancement operations include random rotation, scaling, translation, flipping, brightness adjustment, and color transformation.

[0078] In order to solve the problem of data imbalance between different categories, the synthetic minority oversampling technique (SMOTE) can be used in the data processing stage to analyze minority class samples, and for categories with fewer samples in the data set after data enhancement, the background replacement method can be used to increase the number of samples in the category, and then the new artificially synthesized samples can be added to the data set. That is, the target sample is extracted from the original collected image, and then the extracted target sample is placed in different backgrounds to create a new synthetic image. Furthermore, this method can simulate different scenes and environments to increase the diversity of the data set.

[0079] In addition, in order to increase the robustness of the image segmentation model, in an embodiment of the present application, different types of noise (for example, Gaussian noise, salt and pepper noise) and distortion (such as blurring and distortion) can be added to each sample image of the lawn segmentation dataset to simulate the noise and deformation in the real world, thereby achieving the purpose of increasing the robustness of the image segmentation model.

[0080] In a possible implementation, before the original captured image is input into the trained image segmentation model to obtain the target segmented image, the initial image segmentation model may be trained.

[0081] Specifically, according to the lawn segmentation dataset, based on the pytorch framework (or different training frameworks such as TensorFlow, Caffe, MXNet, PaddlePaddle, MindSpore framework, etc.), the initial image segmentation model can be trained using a multi-machine and multi-card acceleration method to obtain a trained image segmentation model; among them, the multi-machine and multi-card acceleration method is a multi-process distributed parallel method.

[0082] Furthermore, compared to the prior art "the conventional multi-machine and multi-card acceleration method using data parallelism", which has the problem of unifying the loss calculation on one card, resulting in too heavy a load on the first card and causing serious load imbalance, the "multi-process distributed parallel multi-machine and multi-card acceleration method" adopted in this application can avoid the problem of load balancing because each process independently calculates the gradient and then aggregates it.

[0083] In a possible implementation, in order to improve the image segmentation efficiency of the trained image segmentation model, in the embodiment of the present application, the trained image segmentation model may also be optimized.

[0084] Specifically, a 4-bit integer quantization method (for example, a knowledge distillation method, a model pruning method) can be used to further reduce the model parameter amount of the trained image segmentation model and further improve the running speed of the trained image segmentation model. At the same time, in order to address the performance degradation problem of the trained image segmentation model caused by quantization, in the embodiment of the present application, model parameter adjustment and quantization strategy adjustment can also be performed to ensure network performance.

[0085] In a possible implementation, in order to enable the trained and optimized image segmentation model (real-time environment semantic perception model) to be applied in real life, in the embodiment of the present application, the trained and optimized image segmentation model can also be deployed on the automatic lawn mower device. If some operators of the model are not supported by the embedded platform during the deployment process, the operator completion method can be used to solve the problem.

[0086] In a possible implementation, in the embodiment of the present application, the trained image segmentation model can collect data images of different automatic lawn mower scenes during operation and store them locally or in the cloud. After user authorization, the collected data images can also be sent to the trained image segmentation model for incremental training, thereby further improving the performance and generalization ability of the trained image segmentation model.

[0087] To sum up, since the target segmentation image is obtained directly according to the trained image segmentation model, and the trained image segmentation model is obtained based on the improved RepViT-M1.1 module, that is, compared with the prior art, the improved real-time environmental semantic perception method applied to the automatic lawn mower scene proposed in this application can improve the image segmentation accuracy and efficiency by greatly improving the environmental perception ability, thereby optimizing the user interaction experience, reducing product costs, enhancing safety and environmental adaptability, and improving mowing efficiency, providing users with a lawn maintenance solution that is both economical and efficient.

[0088] And, if Figure 5As shown, it is a flow chart of the overall technical solution provided by the embodiment of the present application. The overall technical solution of the present application includes data preprocessing, designing an efficient lightweight model architecture (improved RepViT-M1.1 module), model training, model optimization, model deployment, and real scene data collection to enhance training in a loop. Among them, after the model training is completed, if the accuracy of the trained image segmentation model meets the preset accuracy requirements, the model is optimized; and if the accuracy of the trained image segmentation model does not meet the preset accuracy requirements, it is necessary to add new data images to the dataset used for training lawn segmentation, and re-preprocess the data. Obviously, for the automatic lawn mower scene, the present application proposes a new real-time lightweight segmentation network model (trained image segmentation model). The trained image segmentation model can maintain a high detection accuracy while achieving a low parameter amount. Moreover, for the trained image segmentation model, due to model quantization and operator optimization, the model detection accuracy and speed can be further improved.

[0089] In addition, since the model is trained by collecting and organizing large-scale lawn segmentation data sets, the detection accuracy of the model can be significantly improved, and the detection accuracy of the main grass categories can reach more than 98%. At the same time, the detection speed has also been significantly improved, reaching 15FPS, which can meet the needs of automatic lawn mowers. It solves the shortcomings of current automatic lawn mowers in terms of weak environmental perception and slow algorithm detection speed, and can achieve high adaptability and flexibility to complex environments. It can maintain excellent mowing performance even in a changing outdoor environment, thereby meeting the needs of different users, promoting the development of automatic lawn mower technology, and bringing users a more comfortable and efficient lawn maintenance experience.

[0090] Based on the same inventive concept, the embodiment of the present application provides a real-time environment semantic perception device 60, which is applied to an automatic lawn mower scene, such as Figure 6 As shown, the real-time environment semantics perception device 60 includes:

[0091] The image acquisition unit 601 is used to acquire real-time images of the current environment and obtain original acquired images;

[0092] The segmented image obtaining unit 602 is used to input the original collected image into the trained image segmentation model to obtain a target segmented image; wherein the trained image segmentation model is obtained based on the improved RepViT-M1.1 module, and the improved RepViT-M1.1 module performs a weighted sum of two feature maps obtained by splitting the feature map of the original collected image and a dynamic weight obtained based on a fully connected network and a softmax operation to obtain a first feature map;

[0093] The lawn mowing determination unit 603 is used to determine whether to perform adaptive mowing on the lawn according to the category of the target segmented image.

[0094] Optionally, the segmented image obtaining unit 602 is further configured to:

[0095] The original acquired images are sequentially input into the first four stages of the trained image segmentation model for downsampling to obtain feature maps of 1 / 16 and 1 / 32 sizes;

[0096] Inputting the 1 / 32 size feature map into the fifth stage of the trained image segmentation model for processing to obtain the first feature map; wherein the fifth stage includes an improved RepViT-M1.1 module;

[0097] The attention module is used to enhance the features of the feature map of 1 / 16 size, the feature map of 1 / 32 size, and the first feature map, respectively, to obtain feature maps of three different scales;

[0098] A multi-scale feature fusion module is used to fuse the feature maps of three different scales to obtain a fused feature map;

[0099] The segmentation head is used to upsample the fused feature map to obtain the target segmentation image.

[0100] Optionally, the segmented image obtaining unit 602 is further configured to:

[0101] According to the preset splitting ratio, the 1 / 32 size feature map is split into a second feature map and a third feature map; wherein the second feature map is a characterization feature map, which is used to extract richer feature information; and the third feature map is used to define redundancy;

[0102] Perform 3×3 convolution on the second feature map to extract features and obtain a fifth feature map;

[0103] Perform 1×1 convolution on the third feature map to extract features and obtain a sixth feature map;

[0104] splicing the fifth feature map and the sixth feature map to obtain a spliced ​​feature map;

[0105] The concatenated feature map is processed using a fully connected network and a softmax operation to obtain the dynamic weights corresponding to the fifth feature map and the sixth feature map;

[0106] A weighted sum is performed on the fifth feature map, the sixth feature map, and the dynamic weights corresponding to the fifth feature map and the sixth feature map, to obtain a first feature map.

[0107] Optionally, the segmented image obtaining unit 602 is further configured to:

[0108] Global average pooling is used to extract high-level information from the concatenated feature map to obtain the seventh feature map;

[0109] The seventh feature map is processed using a fully connected network and a softmax operation to obtain the dynamic weights corresponding to the fifth feature map and the sixth feature map.

[0110] Optionally, the real-time environment semantics perception device 60 further includes a data set obtaining unit 604, which is used to:

[0111] According to preset categories, multiple samples in a preset public data set are classified to obtain a first data set; wherein the categories include grass, trees, people, animals, roads, land, water bodies, vehicle equipment and others;

[0112] Capturing images of different actual lawn scenes to obtain a second data set including a plurality of actual samples;

[0113] A lawn segmentation dataset is obtained according to the first dataset and the second dataset.

[0114] Optionally, the real-time environment semantics perception device 60 further includes a data set processing unit 605, which is used to:

[0115] Perform data enhancement operations on multiple samples in the lawn segmentation dataset to obtain a data-enhanced dataset; wherein the data enhancement operations include random rotation, scaling, translation, flipping, brightness adjustment, and color transformation;

[0116] For categories with fewer samples in the data set after data enhancement, background replacement is used to increase the number of samples in the category.

[0117] Optionally, the real-time environment semantics perception device 60 further includes a model training unit 606, which is used to:

[0118] According to the lawn segmentation dataset, the initial image segmentation model is trained by adopting a multi-machine and multi-card acceleration method to obtain a trained image segmentation model; wherein, the multi-machine and multi-card acceleration method is a multi-process distributed parallel method.

[0119] The real-time environment semantics perception device 60 can be used to perform Figure 2-Figure 4 The method executed in the embodiment shown in FIG. 1 is a method for executing the method in the embodiment shown in FIG. 1 . Therefore, for the functions that can be realized by each functional module of the real-time environment semantic perception device 60, reference can be made to FIG. Figure 2-Figure 4 The description of the illustrated embodiment is not repeated in detail.

[0120] In some possible implementations, various aspects of the method provided in the present application may also be implemented in the form of a program part, which includes a program code. When the program part is run on a computer device, the program code is used to enable the computer device to execute the steps of the method according to various exemplary embodiments of the present application described above in this specification. For example, the computer device may execute the following steps: Figure 2-Figure 4 The method performed in the illustrated embodiment.

[0121] Those skilled in the art can understand that all or part of the steps of the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above method embodiment are executed; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks or optical disks. Alternatively, if the above integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent part, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or in other words, the part that contributes to the prior art can be embodied in the form of a software part, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in various embodiments of the present invention. And the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

[0122] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0123] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A real-time environment semantic perception method, characterized in that: Applied to the automatic lawn mower scenario, the method includes: Perform real-time image acquisition of the current environment to obtain the original acquired image; The original acquired image is input into a trained image segmentation model to obtain a target segmented image; wherein the trained image segmentation model is obtained based on an improved RepViT-M1.1 module, and the improved RepViT-M1.1 module performs weighted sum of two feature maps obtained by splitting the feature map of the original acquired image and dynamic weights obtained based on a fully connected network and a softmax operation to obtain a first feature map; the trained image segmentation model includes a first stage, a second stage, a third stage, a fourth stage, a fifth stage, an attention module, a multi-scale feature fusion module and a segmentation head connected in sequence; the first stage is used to downsample the original acquired image to obtain a feature map of 1 / 4 size; the second stage is used to downsample the feature map of 1 / 4 size to obtain a feature map of 1 / 8 size ; The third stage is used to downsample the feature map of size 1 / 8 to obtain a feature map of size 1 / 16; the fourth stage is used to downsample the feature map of size 1 / 16 to obtain a feature map of size 1 / 32; the fifth stage includes an improved RepViT-M1.1 module, and the fifth stage is used to process the feature map of size 1 / 32 to obtain a first feature map; the attention module is used to perform feature enhancement on the feature map of size 1 / 16, the feature map of size 1 / 32 and the first feature map respectively to obtain feature maps of three different scales; the multi-scale feature fusion module is used to perform feature fusion on the feature maps of three different scales to obtain a fused feature map; the segmentation head is used to upsample the fused feature map to obtain the target segmented image; Whether to perform adaptive mowing on the lawn is determined according to the category of the target segmented image.

2. The method according to claim 1, characterized in that The step of inputting the 1 / 32 size feature map into the fifth stage of the trained image segmentation model for processing to obtain the first feature map includes: According to a preset splitting ratio, the 1 / 32 size feature map is split into a second feature map and a third feature map; wherein the second feature map is a characterization feature map for extracting richer feature information; and the third feature map is used to define redundancy; Performing 3×3 convolution on the second feature map to extract features, to obtain a fifth feature map; Performing 1×1 convolution on the third feature map to extract features, to obtain a sixth feature map; Splicing the fifth feature map and the sixth feature map to obtain a spliced ​​feature map; The concatenated feature map is processed using a fully connected network and a softmax operation to obtain dynamic weights corresponding to the fifth feature map and the sixth feature map respectively; A weighted sum is performed on the fifth feature map, the sixth feature map, and the dynamic weights corresponding to the fifth feature map and the sixth feature map, respectively, to obtain the first feature map.

3. The method according to claim 2, characterized in that The step of processing the concatenated feature map using a fully connected network and a softmax operation to obtain dynamic weights corresponding to the fifth feature map and the sixth feature map respectively includes: Using global average pooling to extract high-level information from the concatenated feature map to obtain a seventh feature map; The seventh feature map is processed by using a fully connected network and a softmax operation to obtain dynamic weights corresponding to the fifth feature map and the sixth feature map.

4. The method according to claim 1, characterized in that Before inputting the original captured image into the trained image segmentation model to obtain the target segmented image, the method further includes: According to preset categories, multiple samples in a preset public data set are classified to obtain a first data set; wherein the categories include grass, trees, people, animals, roads, land, water bodies, vehicles and equipment, and others; Capturing images of different actual lawn scenes to obtain a second data set including a plurality of actual samples; A lawn segmentation dataset is obtained according to the first dataset and the second dataset.

5. The method according to claim 4, characterized in that After obtaining a lawn segmentation dataset according to the first dataset and the second dataset, the method further includes: Performing data enhancement operations on multiple samples in the lawn segmentation data set to obtain a data-enhanced data set; wherein the data enhancement operations include random rotation, scaling, translation, flipping, brightness adjustment, and color transformation; For categories with fewer samples in the data set after data enhancement, background replacement is used to increase the number of samples in the category.

6. The method according to claim 4, characterized in that Before inputting the original captured image into the trained image segmentation model to obtain the target segmented image, the method further includes: According to the lawn segmentation data set, the initial image segmentation model is trained by adopting a multi-machine multi-card acceleration method to obtain a trained image segmentation model; wherein the multi-machine multi-card acceleration method is a multi-process distributed parallel method.

7. A real-time environment semantic perception device, characterized in that: Applied to the automatic lawn mower scenario, the device includes: An image acquisition unit is used to acquire real-time images of the current environment and obtain original acquired images; A segmented image acquisition unit is used to input the original acquired image into a trained image segmentation model to obtain a target segmented image; wherein the trained image segmentation model is obtained based on an improved RepViT-M1.1 module, and the improved RepViT-M1.1 module performs weighted sum of two feature maps obtained by splitting the feature map of the original acquired image and dynamic weights obtained based on a fully connected network and a softmax operation to obtain a first feature map; the trained image segmentation model includes a first stage, a second stage, a third stage, a fourth stage, a fifth stage, an attention module, a multi-scale feature fusion module and a segmentation head connected in sequence; the first stage is used to downsample the original acquired image to obtain a feature map of 1 / 4 size; the second stage is used to downsample the feature map of 1 / 4 size to obtain a feature map of 1 / 8 The third stage is used to downsample the feature map of 1 / 8 size to obtain a feature map of 1 / 16 size; the fourth stage is used to downsample the feature map of 1 / 16 size to obtain a feature map of 1 / 32 size; the fifth stage includes an improved RepViT-M1.1 module, and the fifth stage is used to process the feature map of 1 / 32 size to obtain a first feature map; the attention module is used to perform feature enhancement on the feature map of 1 / 16 size, the feature map of 1 / 32 size and the first feature map respectively to obtain feature maps of three different scales; the multi-scale feature fusion module is used to perform feature fusion on the feature maps of the three different scales to obtain a fused feature map; the segmentation head is used to upsample the fused feature map to obtain the target segmented image; The lawn mowing determination unit is used to determine whether to perform adaptive mowing on the lawn according to the category of the target segmented image.

8. An electronic device, characterized in that: The device comprises: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute any method according to claims 1-6 according to the obtained program instructions.

9. A storage medium, characterized in that: The storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute any one of the methods of claims 1-6.