WO2025001002A1 - 一种语义分割方法、装置、计算机可读存储介质及机器人 - Google Patents

一种语义分割方法、装置、计算机可读存储介质及机器人 Download PDF

Info

Publication number
WO2025001002A1
WO2025001002A1 PCT/CN2023/141742 CN2023141742W WO2025001002A1 WO 2025001002 A1 WO2025001002 A1 WO 2025001002A1 CN 2023141742 W CN2023141742 W CN 2023141742W WO 2025001002 A1 WO2025001002 A1 WO 2025001002A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
optical flow
semantic segmentation
model
sample
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2023/141742
Other languages
English (en)
French (fr)
Inventor
潘柏宇
焦继超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ubtech Robotics Corp
Original Assignee
Ubtech Robotics Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ubtech Robotics Corp filed Critical Ubtech Robotics Corp
Publication of WO2025001002A1 publication Critical patent/WO2025001002A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/80Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/70Labelling scene content, e.g. deriving syntactic or semantic representations

Definitions

  • the present application belongs to the field of robotics technology, and in particular, relates to a semantic segmentation method, device, computer-readable storage medium, and robot.
  • semantic segmentation technology has been applied to various scenarios such as autonomous driving, indoor navigation, virtual reality and image recognition.
  • embodiments of the present application provide a semantic segmentation method, device, computer-readable storage medium, and robot to solve the problem that existing semantic segmentation methods have low accuracy when facing new scenarios.
  • a first aspect of an embodiment of the present application provides a semantic segmentation method, which may include:
  • performing optical flow calculation on the first image and the second image to obtain first optical flow data may include:
  • the intermediate output result is used as the first optical flow data.
  • the first optical flow data is fused with the first image.
  • Combine to get the optical flow fusion image which may include:
  • the interpolated optical flow data is fused with the first image to obtain the optical flow fused image.
  • fusing the interpolated optical flow data with the first image to obtain the optical flow fused image may include:
  • the interpolated optical flow result and the first image are spliced in the channel dimension to obtain the optical flow fused image.
  • the method may further include:
  • the preset deep learning model is trained according to the optical flow fusion sample image and the semantic segmentation annotation to obtain the semantic segmentation model.
  • training a preset deep learning model according to the optical flow fusion sample image and the semantic segmentation annotation to obtain the semantic segmentation model may include:
  • the model parameters of the deep learning model are adjusted according to the training loss value to obtain the semantic segmentation model.
  • calculating the training loss value of the deep learning model according to the output result and the semantic segmentation annotation may include:
  • the training loss value is calculated according to the intersection-over-union ratio of the segmented regions.
  • a second aspect of the embodiments of the present application provides a semantic segmentation device, which may include:
  • An image acquisition module used to acquire a first image and a second image; wherein the first image is an image to be semantically segmented, and the second image is an image frame previous to the first image;
  • an optical flow calculation module configured to perform optical flow calculation on the first image and the second image to obtain first optical flow data
  • a data fusion module is used to fuse the first optical flow data with the first image to obtain an optical flow fusion image. picture;
  • the semantic segmentation module is used to perform semantic segmentation on the optical flow fusion image using a preset semantic segmentation model to obtain a semantic segmentation result corresponding to the first image.
  • the optical flow calculation module may include:
  • a result acquisition unit used to input the first image and the second image into a preset optical flow model, and obtain an intermediate output result of the optical flow model; wherein the intermediate output result is an optical flow calculation result before the final output result of the optical flow model;
  • a data determining unit is used to use the intermediate output result as the first optical flow data.
  • the data fusion module may include:
  • a data interpolation unit configured to interpolate the first optical flow data to obtain an interpolated optical flow result consistent with the size of the first image
  • a data fusion unit is used to fuse the interpolated optical flow data with the first image to obtain the optical flow fused image.
  • the data fusion unit may include:
  • the dimension stitching subunit is used to stitch the interpolation optical flow result and the first image in the channel dimension to obtain the optical flow fusion image.
  • the semantic segmentation device may further include:
  • a data acquisition module used to acquire a first sample image, a second sample image and a semantic segmentation annotation corresponding to the first sample image; wherein the second sample image is a previous frame image of the first sample image;
  • a data calculation module configured to perform optical flow calculation on the first sample image and the second sample image to obtain first optical flow sample data
  • an image fusion module configured to fuse the first optical flow sample data with the first sample image to obtain an optical flow fused sample image corresponding to the first sample image
  • the model training module is used to train a preset deep learning model according to the optical flow fusion sample image and the semantic segmentation annotation to obtain the semantic segmentation model.
  • model training module may include:
  • a result acquisition unit used for inputting the optical flow fusion sample image into the deep learning model and acquiring an output result of the deep learning model
  • a loss value calculation unit used to calculate the training loss value of the deep learning model according to the output result and the semantic segmentation annotation
  • a parameter adjustment unit is used to adjust the model parameters of the deep learning model according to the training loss value, to the semantic segmentation model.
  • the loss value calculation unit may include:
  • a first calculation subunit used to calculate the segmentation area intersection-over-union ratio between the output result and the semantic segmentation annotation
  • the second calculation subunit is used to calculate the training loss value according to the intersection-over-union ratio of the segmented regions.
  • a third aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any one of the above-mentioned semantic segmentation methods are implemented.
  • a fourth aspect of an embodiment of the present application provides a robot, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the above-mentioned semantic segmentation methods when executing the computer program.
  • a fifth aspect of an embodiment of the present application provides a computer program product.
  • the computer program product runs on a robot, the robot executes the steps of any one of the above-mentioned semantic segmentation methods.
  • the embodiments of the present application have the following beneficial effects: the embodiments of the present application obtain a first image and a second image; wherein the first image is an image to be semantically segmented, and the second image is an image of the previous frame of the first image; optical flow calculation is performed on the first image and the second image to obtain first optical flow data; the first optical flow data is fused with the first image to obtain an optical flow fused image; the optical flow fused image is semantically segmented using a preset semantic segmentation model to obtain a semantic segmentation result corresponding to the first image.
  • semantic segmentation can be performed in combination with the optical flow data of the image, so that the deep features of the image can be mined, and the unknown objects can be better semantically segmented, thereby effectively improving the accuracy of the semantic segmentation method.
  • FIG1 is a schematic flow chart of the semantic segmentation model training process
  • FIG2 is a schematic diagram of the training process of the optical flow model and the semantic segmentation model
  • FIG3 is a flow chart of an embodiment of a semantic segmentation method in an embodiment of the present application.
  • FIG4 is a structural diagram of an embodiment of a semantic segmentation device in an embodiment of the present application.
  • FIG5 is a schematic block diagram of a robot in an embodiment of the present application.
  • the term “if” may be interpreted as “when” or “upon” or “in response to determining” or “in response to detecting,” depending on the context.
  • the phrases “if it is determined” or “if [described condition or event] is detected” may be interpreted as meaning “upon determination” or “in response to determining” or “upon detection of [described condition or event]” or “in response to detecting [described condition or event],” depending on the context.
  • semantic segmentation technology has been applied to various scenarios such as autonomous driving, indoor navigation, virtual reality and image recognition.
  • the embodiments of the present application provide a semantic segmentation method, device, computer-readable storage medium and robot to solve the problem that the existing semantic segmentation method has low accuracy when facing new scenes.
  • semantic segmentation can be performed in combination with the optical flow data of the image, so that the deep features of the image can be mined, and the semantic segmentation of unknown objects can be better performed, thereby effectively improving the accuracy of the semantic segmentation method.
  • the executor of the method of the present application is a robot, which may include but is not limited to a sweeping robot, an inspection robot, a food delivery robot, a guiding robot, and any other common robots in the prior art.
  • the optical flow calculation can be performed on the image by using a preset optical flow model, and the preset language
  • the semantic segmentation model performs semantic segmentation on the image. Therefore, the optical flow model and the semantic segmentation model in the embodiment of the present application will be first introduced below.
  • the optical flow model in the embodiment of the present application can be preferably a lightweight deep learning model.
  • the optical flow model can be used to estimate the optical flow of the image.
  • the optical flow model can include an encoder and a decoder, wherein the encoder can be mainly used for pyramid multi-scale feature extraction, and the decoder can be mainly used for optical flow estimation.
  • the original deep learning model can be trained to obtain the optical flow model.
  • two consecutive frames of sample images can be obtained, and the optical flow of the sample images can be annotated using any optical flow estimation method in the prior art to obtain expected optical flow data (Ground Truth); thereafter, the two frames of sample images can be used as input of the original deep learning model, and the corresponding expected optical flow data can be used as the expected output of the original deep learning model to train the original deep learning model.
  • Ground Truth expected optical flow data
  • optical flow model of the embodiment of the present application can be obtained.
  • the expected optical flow data can also be used to supervise the output predicted optical flow data.
  • the model training loss value can be calculated based on the predicted optical flow data and the expected optical flow data output during the model training process.
  • the calculation formula can be:
  • x is the difference between the predicted optical flow data and the expected optical flow data
  • ⁇ and c are hyperparameters, and the values of the two hyperparameters can be set according to actual needs, which is not specifically limited in the embodiment of the present application.
  • a semantic segmentation model may also be used to perform semantic segmentation on an image, wherein the semantic segmentation model may be any deep learning model in the prior art that can be used for semantic segmentation.
  • the original deep learning Specifically, a semantic segmentation training sample set can be constructed, and the deep learning model can be trained using the semantic segmentation training sample set.
  • the training process of the semantic segmentation model can include the following steps:
  • Step S101 Obtain a first sample image, a second sample image, and a semantic segmentation annotation corresponding to the first sample image.
  • a preset camera acquisition device can be used to capture video, and two adjacent frames of images in the video can be obtained.
  • the t-th frame image and the t-1-th frame image in the video can be obtained, where t is a positive integer, and the t-th frame image is recorded as the first sample image, and the t-1-th frame image is recorded as the second sample image.
  • the semantic segmentation annotation corresponding to the first sample image can also be obtained, wherein the semantic segmentation annotation of the image may include the number of pixels and pixel positions in the semantic segmentation area, that is, the number of pixels and pixel positions of each object in the image.
  • any semantic segmentation method in the prior art can be used to perform semantic segmentation to segment each object in the first sample image and the area corresponding to each object.
  • Step S102 perform optical flow calculation on the first sample image and the second sample image to obtain first optical flow sample data.
  • the optical flow data of an image is a deep feature of the image and can be used to describe the movement of objects in the image, making it easier to distinguish between static objects and dynamic objects in the image. Based on this, the foreground and background of the image can be effectively distinguished. Therefore, when there are unknown objects in the image, introducing the optical flow data of the image helps to perform semantic segmentation of the unknown objects.
  • an optical flow model can be used to perform optical flow calculation on the first sample image and the second sample image.
  • the first sample image and the second sample image can be input into the optical flow model, after which the first sample image and the second sample image will pass through the encoder and the decoder, where the intermediate output result of the decoder (Half Size output result) can be used as the first optical flow sample data, where the intermediate output result is the output result before the final output result of the optical flow model, and specifically the output result of the intermediate layer of the decoder can be used as the intermediate output result, where the size of the intermediate output result is half of the final output result (Half Size).
  • Step S103 Fusing the first optical flow sample data with the first sample image to obtain an optical flow fused sample image corresponding to the first sample image.
  • the first optical flow sample data can be interpolated to obtain an interpolated sample optical flow result consistent with the size of the first sample image.
  • the first optical flow data can be interpolated using any interpolation method in the prior art, including but not limited to any common interpolation method in the prior art such as bilinear interpolation, bicubic interpolation and nearest neighbor interpolation.
  • bilinear interpolation can be used here to interpolate the first optical flow data.
  • Input Semantic is the optical flow fusion sample image
  • Flow is the first optical flow sample data
  • Upsample(Flow) is the interpolated sample optical flow result
  • Frame t is the first sample image
  • Concat is the splicing operation.
  • Step S104 training a preset deep learning model according to the optical flow fusion sample image and the semantic segmentation annotation to obtain a semantic segmentation model.
  • the optical flow fusion sample image can be used as the input of the original deep learning model, and the semantic segmentation annotation corresponding to the optical flow fusion sample image can be used as the output of the original deep learning model to train the original deep learning model.
  • the structure of the original deep learning model can be specific and situationalized according to actual needs, and this application does not limit this.
  • the original deep learning model preferably includes convolutional layers and pooling layers, etc., and can perform common operations such as pyramid multi-scale feature extraction, pooling, and splicing.
  • the training loss value can also be calculated according to the output result of the original deep learning model and the semantic segmentation annotation.
  • the intersection-over-Union (IoU) of the segmented area between the output result and the semantic segmentation annotation can be calculated, where the intersection-over-Union (IoU) can be used to indicate the overlap between the segmented areas of the two results, and the calculation formula is as follows:
  • dice is the intersection-over-union ratio of the segmented area between the output result and the semantic segmentation annotation
  • X is the output result of the deep learning model, that is, the number of pixels and pixel positions of the output semantic segmentation area
  • Y is the semantic segmentation annotation, that is, the number of pixels and pixel positions of the semantic segmentation area of the first sample image
  • is the intersection between the output semantic segmentation area and the semantic segmentation area of the first sample image
  • is the union between the output semantic segmentation area and the semantic segmentation area of the first sample image.
  • the training loss value L dice can be calculated according to the intersection-over-union ratio of the segmented region.
  • the calculation formula can be as follows:
  • the model parameters of the deep learning model can be adjusted according to the training loss value.
  • the parameters of the deep learning model can be adjusted according to the reverse update method.
  • semantic segmentation model performs semantic segmentation on the image. Please refer to FIG3.
  • An embodiment of a semantic segmentation method in an embodiment of the present application may include:
  • Step S301 Acquire a first image and a second image.
  • a monocular camera may preferably be used to capture video of the area to be semantically segmented, and the t-th frame image in the captured video may be used as the first image, and the t-1-th frame image may be used as the second image.
  • the method of the present application can be specifically applied to the navigation process of a robot, and the area to be semantically segmented can be the driving area of the robot.
  • a monocular camera installed on the robot can be used to capture video of the driving area, and the tth frame image in the captured video can be used as the first image, and the t-1th frame image in the video can be used as the second image.
  • Step S302 perform optical flow calculation on the first image and the second image to obtain first optical flow data.
  • the first image and the second image may be specifically input into a trained optical flow model, and an intermediate output result of the optical flow model may be obtained, and the intermediate output result may be used as the first optical flow data.
  • Step S303 Fuse the first optical flow data with the first image to obtain an optical flow fused image.
  • the first optical flow data in order to enable the first optical flow data to be smoothly fused with the first image, can be interpolated to obtain an interpolated optical flow result consistent with the size of the first image. Thereafter, the interpolated optical flow data can be spliced with the first image in the channel dimension to obtain an optical flow fused image.
  • step S303 can refer to the relevant description of step S103, which will not be repeated here.
  • Step S304 Use a preset semantic segmentation model to perform semantic segmentation on the optical flow fusion image to obtain a semantic segmentation result corresponding to the first image.
  • a trained semantic segmentation model can be used to perform semantic segmentation on the optical flow fusion image.
  • the optical flow fusion image can be used as an input of the semantic segmentation model to obtain a semantic segmentation result corresponding to the first image.
  • the semantic segmentation result may include relevant information of known objects and unknown objects.
  • the semantic segmentation result corresponding to the first image can be used for navigation, exploration, motion control and other related applications.
  • the method of the present application can be applied to a specific application scenario of navigation, and the first image can be an image of a driving area collected, and the semantic segmentation model can be used to segment the drivable area, obstacles, pedestrians and other objects in the driving area, and navigation can be performed accordingly.
  • the embodiment of the present application obtains a first image and a second image; wherein the first image is an image to be semantically segmented, and the second image is an image frame previous to the first image; optical flow calculation is performed on the first image and the second image to obtain first optical flow data; the first optical flow data is fused with the first image to obtain an optical flow fused image; the optical flow fused image is semantically segmented using a preset semantic segmentation model to obtain a semantic segmentation result corresponding to the first image.
  • semantic segmentation can be performed in combination with the optical flow data of the image, so that the deep features of the image can be mined, and the semantic segmentation of unknown objects can be better performed, thereby effectively Improved the accuracy of semantic segmentation methods.
  • FIG4 shows a structural diagram of an embodiment of a semantic segmentation device provided in an embodiment of the present application.
  • a semantic segmentation device may include:
  • An image acquisition module 401 is used to acquire a first image and a second image; wherein the first image is an image to be semantically segmented, and the second image is an image frame previous to the first image;
  • a data fusion module 403, configured to fuse the first optical flow data with the first image to obtain an optical flow fused image
  • the semantic segmentation module 404 is used to perform semantic segmentation on the optical flow fusion image using a preset semantic segmentation model to obtain a semantic segmentation result corresponding to the first image.
  • the optical flow calculation module may include:
  • a result acquisition unit used to input the first image and the second image into a preset optical flow model, and obtain an intermediate output result of the optical flow model; wherein the intermediate output result is an optical flow calculation result before the final output result of the optical flow model;
  • a data determining unit is used to use the intermediate output result as the first optical flow data.
  • the data fusion module may include:
  • a data interpolation unit configured to interpolate the first optical flow data to obtain an interpolated optical flow result consistent with the size of the first image
  • a data fusion unit is used to fuse the interpolated optical flow data with the first image to obtain the optical flow fused image.
  • the data fusion unit may include:
  • the dimension stitching subunit is used to stitch the interpolation optical flow result and the first image in the channel dimension to obtain the optical flow fusion image.
  • the semantic segmentation device may further include:
  • a data acquisition module used to acquire a first sample image, a second sample image and a semantic segmentation annotation corresponding to the first sample image; wherein the second sample image is a previous frame image of the first sample image;
  • a data calculation module configured to perform optical flow calculation on the first sample image and the second sample image to obtain first optical flow sample data
  • an image fusion module configured to fuse the first optical flow sample data with the first sample image to obtain an optical flow fused sample image corresponding to the first sample image
  • the model training module is used to train a preset deep learning model according to the optical flow fusion sample image and the semantic segmentation annotation to obtain the semantic segmentation model.
  • the model training module may include:
  • a result acquisition unit used for inputting the optical flow fusion sample image into the deep learning model and acquiring an output result of the deep learning model
  • a loss value calculation unit used to calculate the training loss value of the deep learning model according to the output result and the semantic segmentation annotation
  • a parameter adjustment unit is used to adjust the model parameters of the deep learning model according to the training loss value to obtain the semantic segmentation model.
  • the loss value calculation unit may include:
  • a first calculation subunit used to calculate the segmentation area intersection-over-union ratio between the output result and the semantic segmentation annotation
  • the second calculation subunit is used to calculate the training loss value according to the intersection-over-union ratio of the segmented regions.
  • FIG5 shows a schematic block diagram of a robot provided in an embodiment of the present application. For ease of explanation, only the parts related to the embodiment of the present application are shown.
  • the robot 5 of this embodiment includes: a processor 50, a memory 51, and a computer program 52 stored in the memory 51 and executable on the processor 50.
  • the processor 50 executes the computer program 52, the steps in the above-mentioned various semantic segmentation method embodiments are implemented, such as steps S301 to S304 shown in FIG3 .
  • the processor 50 executes the computer program 52, the functions of the modules/units in the above-mentioned various device embodiments are implemented, such as the functions of modules 401 to 404 shown in FIG4 .
  • the computer program 52 may be divided into one or more modules/units, which are stored in the memory 51 and executed by the processor 50 to complete the present application.
  • the one or more modules/units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the computer program. The execution process of the computer program 52 in the robot 5 is described.
  • FIG5 is merely an example of the robot 5 and does not constitute a limitation on the robot 5.
  • the robot 5 may include more or fewer components than shown in the figure, or a combination of certain components, or different components.
  • the robot 5 may also include input and output devices, network access devices, buses, etc.
  • the processor 50 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general-purpose processor may be a microprocessor or any conventional processor, etc.
  • the memory 51 may be an internal storage unit of the robot 5, such as a hard disk or memory of the robot 5.
  • the memory 51 may also be an external storage device of the robot 5, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the robot 5. Further, the memory 51 may also include both an internal storage unit and an external storage device of the robot 5.
  • the memory 51 is used to store the computer program and other programs and data required by the robot 5.
  • the memory 51 may also be used to temporarily store data that has been output or is to be output.
  • the technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration.
  • the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
  • the functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.
  • the disclosed devices/robots and methods can be implemented in other ways.
  • the device/robot embodiments described above are merely schematic.
  • the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
  • Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
  • the integrated module/unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program.
  • the computer program can be stored in a computer-readable storage medium.
  • the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented.
  • the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form.
  • the computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • electric carrier signal telecommunication signal and software distribution medium.
  • the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.
  • the computer-readable storage medium does not include electric carrier signal and telecommunication signal.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Evolutionary Computation (AREA)
  • Databases & Information Systems (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Image Analysis (AREA)

Abstract

本申请属于机器人技术领域,尤其涉及一种语义分割方法、装置、计算机可读存储介质及机器人。所述方法包括:获取第一图像和第二图像;其中,所述第一图像为待进行语义分割的图像,所述第二图像为所述第一图像的前一帧图像;对所述第一图像和所述第二图像进行光流计算,得到第一光流数据;将所述第一光流数据与所述第一图像进行融合,得到光流融合图像;使用预设的语义分割模型对所述光流融合图像进行语义分割,得到与所述第一图像对应的语义分割结果。通过上述方法,可以结合图像的光流数据进行语义分割,从而能够挖掘图像的深层特征,能更好地对未知物体进行语义分割,进而有效地提升了语义分割方法的准确率。

Description

一种语义分割方法、装置、计算机可读存储介质及机器人
本申请要求于2023年06月28日在中国专利局提交的、申请号为202310781685.7、发明名称为“一种语义分割方法、装置、计算机可读存储介质及机器人”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请属于机器人技术领域,尤其涉及一种语义分割方法、装置、计算机可读存储介质及机器人。
背景技术
随着智能技术的发展,语义分割技术得以应用于自动驾驶、室内导航、虚拟现实和图像识别等多种场景。
在现有技术中,在利用语义分割模型对图像进行语义分割之前,通常需要通过语义分割训练集对语义分割模型进行训练。然而,当所在场景发生变化时,新的场景中可能会出现不存在于语义分割训练集中的未知物体,导致语义分割方法的准确率较低。
技术问题
有鉴于此,本申请实施例提供了一种语义分割方法、装置、计算机可读存储介质及机器人,以解决现有的语义分割方法在面对新场景时准确率较低的问题。
技术解决方案
本申请实施例的第一方面提供了一种语义分割方法,可以包括:
获取第一图像和第二图像;其中,所述第一图像为待进行语义分割的图像,所述第二图像为所述第一图像的前一帧图像;
对所述第一图像和所述第二图像进行光流计算,得到第一光流数据;
将所述第一光流数据与所述第一图像进行融合,得到光流融合图像;
使用预设的语义分割模型对所述光流融合图像进行语义分割,得到与所述第一图像对应的语义分割结果。
在第一方面的一种具体实现方式中,所述对所述第一图像和所述第二图像进行光流计算,得到第一光流数据,可以包括:
将所述第一图像和所述第二图像输入至预设的光流模型,并获取所述光流模型的中间输出结果;其中,所述中间输出结果为所述光流模型的最终输出结果之前的光流计算结果;
将所述中间输出结果作为所述第一光流数据。
在第一方面的一种具体实现方式中,所述将所述第一光流数据与所述第一图像进行融 合,得到光流融合图像,可以包括:
对所述第一光流数据进行插值,得到与所述第一图像的尺寸一致的插值光流结果;
将所述插值光流数据与所述第一图像进行融合,得到所述光流融合图像。
在第一方面的一种具体实现方式中,所述将所述插值光流数据与所述第一图像进行融合,得到所述光流融合图像,可以包括:
将所述插值光流结果和所述第一图像在通道维度上进行拼接,得到所述光流融合图像。
在第一方面的一种具体实现方式中,在使用预设的语义分割模型对所述光流融合图像进行语义分割,得到与所述第一图像对应的语义分割结果之前,还可以包括:
获取第一样本图像、第二样本图像和与所述第一样本图像对应的语义分割标注;其中,所述第二样本图像为所述第一样本图像的前一帧图像;
对所述第一样本图像和所述第二样本图像进行光流计算,得到第一光流样本数据;
将所述第一光流样本数据与所述第一样本图像进行融合,得到与所述第一样本图像对应的光流融合样本图像;
根据所述光流融合样本图像和所述语义分割标注对预设的深度学习模型进行训练,得到所述语义分割模型。
在第一方面的一种具体实现方式中,所述根据所述光流融合样本图像和所述语义分割标注对预设的深度学习模型进行训练,得到所述语义分割模型,可以包括:
将所述光流融合样本图像输入至所述深度学习模型,并获取所述深度学习模型的输出结果;
根据所述输出结果和所述语义分割标注计算所述深度学习模型的训练损失值;
根据所述训练损失值对所述深度学习模型进行模型参数调整,得到所述语义分割模型。
在第一方面的一种具体实现方式中,所述根据所述输出结果和所述语义分割标注计算所述深度学习模型的训练损失值,可以包括:
计算所述输出结果和所述语义分割标注之间的分割区域交并比;
根据所述分割区域交并比计算所述训练损失值。
本申请实施例的第二方面提供了一种语义分割装置,可以包括:
图像获取模块,用于获取第一图像和第二图像;其中,所述第一图像为待进行语义分割的图像,所述第二图像为所述第一图像的前一帧图像;
光流计算模块,用于对所述第一图像和所述第二图像进行光流计算,得到第一光流数据;
数据融合模块,用于将所述第一光流数据与所述第一图像进行融合,得到光流融合图 像;
语义分割模块,用于使用预设的语义分割模型对所述光流融合图像进行语义分割,得到与所述第一图像对应的语义分割结果。
在第二方面的一种具体实现方式中,所述光流计算模块可以包括:
结果获取单元,用于将所述第一图像和所述第二图像输入至预设的光流模型,并获取所述光流模型的中间输出结果;其中,所述中间输出结果为所述光流模型的最终输出结果之前的光流计算结果;
数据确定单元,用于将所述中间输出结果作为所述第一光流数据。
在第二方面的一种具体实现方式中,所述数据融合模块可以包括:
数据插值单元,用于对所述第一光流数据进行插值,得到与所述第一图像的尺寸一致的插值光流结果;
数据融合单元,用于将所述插值光流数据与所述第一图像进行融合,得到所述光流融合图像。
在第二方面的一种具体实现方式中,所述数据融合单元可以包括:
维度拼接子单元,用于将所述插值光流结果和所述第一图像在通道维度上进行拼接,得到所述光流融合图像。
在第二方面的一种具体实现方式中,所述语义分割装置还可以包括:
数据获取模块,用于获取第一样本图像、第二样本图像和与所述第一样本图像对应的语义分割标注;其中,所述第二样本图像为所述第一样本图像的前一帧图像;
数据计算模块,用于对所述第一样本图像和所述第二样本图像进行光流计算,得到第一光流样本数据;
图像融合模块,用于将所述第一光流样本数据与所述第一样本图像进行融合,得到与所述第一样本图像对应的光流融合样本图像;
模型训练模块,用于根据所述光流融合样本图像和所述语义分割标注对预设的深度学习模型进行训练,得到所述语义分割模型。
在第二方面的一种具体实现方式中,所述模型训练模块可以包括:
结果获取单元,用于将所述光流融合样本图像输入至所述深度学习模型,并获取所述深度学习模型的输出结果;
损失值计算单元,用于根据所述输出结果和所述语义分割标注计算所述深度学习模型的训练损失值;
参数调整单元,用于根据所述训练损失值对所述深度学习模型进行模型参数调整,得 到所述语义分割模型。
在第二方面的一种具体实现方式中,所述损失值计算单元可以包括:
第一计算子单元,用于计算所述输出结果和所述语义分割标注之间的分割区域交并比;
第二计算子单元,用于根据所述分割区域交并比计算所述训练损失值。
本申请实施例的第三方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述任一种语义分割方法的步骤。
本申请实施例的第四方面提供了一种机器人,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述任一种语义分割方法的步骤。
本申请实施例的第五方面提供了一种计算机程序产品,当计算机程序产品在机器人上运行时,使得机器人执行上述任一种语义分割方法的步骤。
有益效果
本申请实施例与现有技术相比存在的有益效果是:本申请实施例获取第一图像和第二图像;其中,所述第一图像为待进行语义分割的图像,所述第二图像为所述第一图像的前一帧图像;对所述第一图像和所述第二图像进行光流计算,得到第一光流数据;将所述第一光流数据与所述第一图像进行融合,得到光流融合图像;使用预设的语义分割模型对所述光流融合图像进行语义分割,得到与所述第一图像对应的语义分割结果。通过本申请实施例,可以结合图像的光流数据进行语义分割,从而能够挖掘图像的深层特征,能更好地对未知物体进行语义分割,进而有效地提升了语义分割方法的准确率。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为语义分割模型训练过程的示意流程图;
图2为光流模型和语义分割模型训练过程的示意图;
图3为本申请实施例中一种语义分割方法的一个实施例流程图;
图4为本申请实施例中一种语义分割装置的一个实施例结构图;
图5为本申请实施例中一种机器人的示意框图。
本发明的实施方式
为使得本申请的发明目的、特征、优点能够更加的明显和易懂,下面将结合本申请实 施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,下面所描述的实施例仅仅是本申请一部分实施例,而非全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
还应当理解,在此本申请说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本申请。如在本申请说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。
还应当进一步理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
如在本说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。
另外,在本申请的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。
随着智能技术的发展,语义分割技术得以应用于自动驾驶、室内导航、虚拟现实和图像识别等多种场景。
在现有技术中,在利用语义分割模型对图像进行语义分割之前,通常需要通过语义分割训练集对语义分割模型进行训练。然而,当所在场景发生变化时,新的场景中可能会出现不存在于语义分割训练集中的未知物体,导致语义分割方法的准确率较低。
有鉴于此,本申请实施例提供了一种语义分割方法、装置、计算机可读存储介质及机器人,以解决现有的语义分割方法在面对新场景时准确率较低的问题。通过本申请实施例,可以结合图像的光流数据进行语义分割,从而能够挖掘图像的深层特征,能更好地对未知物体进行语义分割,进而有效地提升了语义分割方法的准确率。
需要说明的是,本申请方法的执行主体为机器人,可以包括但不限于扫地机、巡检机器人、送餐机器人、引导机器人等现有技术中任意一种常见的机器人。
在本申请实施例中,可以通过预设的光流模型对图像进行光流计算,及通过预设的语 义分割模型对图像进行语义分割。因此,下面将首先对本申请实施例中的光流模型和语义分割模型进行介绍。
本申请实施例中的光流模型可以优选为轻量级的深度学习模型,通过光流模型,可以对图像进行光流估计,具体地,光流模型可以包括编码器(Encoder)和解码器(Decoder),其中,编码器主要可以用于进行金字塔多尺度特征提取,解码器主要可以用于进行光流估计。
可以理解的是,在利用光流模型进行光流估计之前,可以对原始的深度学习模型进行训练,得到光流模型。
具体地,可以获取连续的两帧样本图像,并利用现有技术中任意一种光流估计方法对样本图像的光流进行标注,得到预期光流数据(Ground Truth);之后,可以将两帧样本图像作为原始的深度学习模型的输入,将对应的预期光流数据作为原始的深度学习模型的预期输出,对原始的深度学习模型进行训练。
可以理解的是,遍历获取到的预设数目的连续两帧样本图像,并重复执行上述训练过程,即可得到本申请实施例的光流模型。
在本申请实施例的一种具体实现方式中,为了保证原始的深度学习模型的训练效果,还可以利用预期光流数据对输出的预测光流数据进行监督,具体可以根据模型训练过程中输出的预测光流数据与预期光流数据,计算模型训练损失值,计算公式可以为:
其中,x为预测光流数据与预期光流数据之间的差值,α和c为超参数,两个超参数的取值可以根据实际需要进行设置,本申请实施例对此不作具体限定。
可以理解的是,当训练损失值小于预设的损失值阈值时,或者,当模型训练的迭代次数大于预设的次数阈值时,则可以认为得到的光流模型较为准确,从而确定模型训练完成。
在本申请实施例中,还可以利用语义分割模型对图像进行语义分割,其中,语义分割模型可以为现有技术中任意一种可用于进行语义分割的深度学习模型。
可以理解的是,在利用语义分割模型对图像进行语义分割之前,可以对原始的深度学 习模型进行训练,得到语义分割模型。具体地,可以构建语义分割训练样本集,并利用语义分割训练样本集对深度学习模型进行训练,此处,可以参阅图1,语义分割模型的训练过程可以包括如下步骤:
步骤S101、获取第一样本图像、第二样本图像和与第一样本图像对应的语义分割标注。
在本申请实施例中,可以使用预设的摄像采集装置进行视频采集,并可以获取视频中相邻的两帧图像,此处,可以获取视频中的第t帧图像和第t-1帧图像,其中,t为正整数,并将第t帧图像记为第一样本图像,将第t-1帧图像记为第二样本图像。
另外,还可以获取与第一样本图像对应的语义分割标注,其中,图像的语义分割标注可以包括语义分割区域的像素个数和像素位置,即该图像中各个物体的像素个数和像素位置,具体地,可以使用现有技术中任意一种语义分割方法进行语义分割,分割出第一样本图像中的各个物体及各个物体分别对应的区域。
步骤S102、对第一样本图像和第二样本图像进行光流计算,得到第一光流样本数据。
可以理解的是,图像的光流数据是图像的深层特征,可以用于描述图像中物体的运动,从而可以更容易分辨图像中的静态物体和动态物体,据此,可以有效区分图像的前景和背景,因此,当图像中存在未知物体时,引入图像的光流数据有助于进行未知物体的语义分割。
在本申请实施例中,具体可以使用光流模型对第一样本图像和第二样本图像进行光流计算。具体地,请参阅图2,可以将第一样本图像和第二样本图像输入至光流模型,之后,第一样本图像与第二样本图像会经过编码器与解码器,此处,可以将解码器的中间输出结果(Half Size输出结果)作为第一光流样本数据,其中,中间输出结果为光流模型最终输出结果之前的输出结果,具体可将解码器的中间层的输出结果作为中间输出结果,此处,中间输出结果的尺寸为最终输出结果的一半(Half Size)。
步骤S103、将第一光流样本数据与第一样本图像进行融合,得到与第一样本图像对应的光流融合样本图像。
在本申请实施例中,可以对第一光流样本数据进行插值,得到与第一样本图像的尺寸一致的插值样本光流结果,具体地,可以利用现有技术中任意一种插值方法对第一光流数据进行插值,包括但不限于双线性插值、双三次插值和最近邻插值法等现有技术中任意一种常见的插值方法,优选地,此处可以使用双线性插值对第一光流数据进行插值。
之后,可以将插值样本光流结果和第一样本图像在通道维度上进行拼接(Concat),得到光流融合样本图像,如下式所示:
InputSemantic=Concat(Upsample(Flow),Framet)
其中,InputSemantic为光流融合样本图像,Flow为第一光流样本数据,Upsample(Flow)为插值样本光流结果,Framet为第一样本图像,Concat为拼接操作。
步骤S104、根据光流融合样本图像和语义分割标注对预设的深度学习模型进行训练,得到语义分割模型。
在本申请实施例中,具体可以将光流融合样本图像作为原始的深度学习模型的输入,将光流融合样本图像对应的语义分割标注作为原始的深度学习模型的输出,对原始的深度学习模型进行训练。
可以理解的是,原始的深度学习模型的结构可以根据实际需要进行具体化、情景化设置,本申请对此不作限定。在本申请实施例中,原始深度学习模型优选可以包括卷积层和池化层等,并可以进行金字塔多尺度特征提取、池化、拼接等常见的操作。
在本申请实施例的一种具体实现方式中,还可以根据原始的深度学习模型的输出结果和语义分割标注计算训练损失值,此处,可以计算输出结果和语义分割标注之间的分割区域交并比(Intersection-over Union,IoU),其中,交并比可用于表示两个结果的分割区域之间的重合度,计算公式如下:
具体地,dice为输出结果和语义分割标注之间的分割区域交并比,X为深度学习模型的输出结果,即输出的语义分割区域的像素个数和像素位置,Y为语义分割标注,即第一样本图像的语义分割区域的像素个数和像素位置,|X∩Y|为输出的语义分割区域与第一样本图像的语义分割区域之间的交集,|X|+|Y|为输出的语义分割区域与第一样本图像的语义分割区域之间的并集。
之后,可以根据该分割区域交并比计算训练损失值Ldice,计算公式可如下;
在得到训练损失值后,可以根据训练损失值对深度学习模型的模型参数进行调整。例如,可以根据反向更新的方式对深度学习模型进行参数调整。
可以理解的是,当训练损失值小于预设的损失值阈值时,或者,当模型训练的迭代次数大于预设的次数阈值时,可以认为得到的语义分割模型较为准确,此时,可以使用该语 义分割模型对图像进行语义分割,请参阅图3,本申请实施例中一种语义分割方法的一个实施例可以包括:
步骤S301、获取第一图像和第二图像。
在本申请实施例中,优选可以使用单目相机对待进行语义分割的区域进行视频采集,并将采集到的视频中第t帧图像作为第一图像,将第t-1帧图像作为第二图像。
例如,本申请方法具体可应用于机器人的导航过程,则待进行语义分割的区域可以为机器人的行驶区域,此时可以利用安装于机器人的单目相机对行驶区域进行视频采集,并将采集到的视频中的第t帧图像作为第一图像,将视频中的第t-1帧图像作为第二图像。
步骤S302、对第一图像和第二图像进行光流计算,得到第一光流数据。
在本申请实施例中,具体可以将第一图像和第二图像输入至训练得到的光流模型,并可以获取光流模型的中间输出结果,将该中间输出结果作为第一光流数据。
步骤S303、将第一光流数据与第一图像进行融合,得到光流融合图像。
在本申请实施例中,为了使得第一光流数据能顺利与第一图像进行融合,可以对第一光流数据进行插值,得到与第一图像尺寸一致的插值光流结果,之后,可以将插值光流数据与第一图像在通道维度上进行拼接,得到光流融合图像。
可以理解的是,步骤S303的具体内容可参考步骤S103的相关描述,此处不再赘述。
步骤S304、使用预设的语义分割模型对光流融合图像进行语义分割,得到与第一图像对应的语义分割结果。
在本申请实施例中,可以使用训练好的语义分割模型对光流融合图像进行语义分割,具体地,可以将光流融合图像作为语义分割模型的输入,即可得到与第一图像对应的语义分割结果。其中,语义分割结果可以包括已知物体和未知物体的相关信息。
在本申请实施例的一种具体实现方式中,可以利用与第一图像对应的语义分割结果进行导航、探索及运动控制等相关应用。例如,本申请方法可以应用于导航的具体应用场景,第一图像可以为采集到的行驶区域的图像,则可以利用语义分割模型分割出行驶区域中的可行驶区域、障碍物、行人等物体,并据此进行导航。
综上所述,本申请实施例获取第一图像和第二图像;其中,所述第一图像为待进行语义分割的图像,所述第二图像为所述第一图像的前一帧图像;对所述第一图像和所述第二图像进行光流计算,得到第一光流数据;将所述第一光流数据与所述第一图像进行融合,得到光流融合图像;使用预设的语义分割模型对所述光流融合图像进行语义分割,得到与所述第一图像对应的语义分割结果。通过本申请实施例,可以结合图像的光流数据进行语义分割,从而能够挖掘图像的深层特征,能更好地对未知物体进行语义分割,进而有效地 提升了语义分割方法的准确率。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
对应于上文实施例所述的一种语义分割方法,图4示出了本申请实施例提供的一种语义分割装置的一个实施例结构图。
本实施例中,一种语义分割装置可以包括:
图像获取模块401,用于获取第一图像和第二图像;其中,所述第一图像为待进行语义分割的图像,所述第二图像为所述第一图像的前一帧图像;
光流计算模块402,用于对所述第一图像和所述第二图像进行光流计算,得到第一光流数据;
数据融合模块403,用于将所述第一光流数据与所述第一图像进行融合,得到光流融合图像;
语义分割模块404,用于使用预设的语义分割模型对所述光流融合图像进行语义分割,得到与所述第一图像对应的语义分割结果。
在本申请实施例的一种具体实现方式中,所述光流计算模块可以包括:
结果获取单元,用于将所述第一图像和所述第二图像输入至预设的光流模型,并获取所述光流模型的中间输出结果;其中,所述中间输出结果为所述光流模型的最终输出结果之前的光流计算结果;
数据确定单元,用于将所述中间输出结果作为所述第一光流数据。
在本申请实施例的一种具体实现方式中,所述数据融合模块可以包括:
数据插值单元,用于对所述第一光流数据进行插值,得到与所述第一图像的尺寸一致的插值光流结果;
数据融合单元,用于将所述插值光流数据与所述第一图像进行融合,得到所述光流融合图像。
在本申请实施例的一种具体实现方式中,所述数据融合单元可以包括:
维度拼接子单元,用于将所述插值光流结果和所述第一图像在通道维度上进行拼接,得到所述光流融合图像。
在本申请实施例的一种具体实现方式中,所述语义分割装置还可以包括:
数据获取模块,用于获取第一样本图像、第二样本图像和与所述第一样本图像对应的语义分割标注;其中,所述第二样本图像为所述第一样本图像的前一帧图像;
数据计算模块,用于对所述第一样本图像和所述第二样本图像进行光流计算,得到第一光流样本数据;
图像融合模块,用于将所述第一光流样本数据与所述第一样本图像进行融合,得到与所述第一样本图像对应的光流融合样本图像;
模型训练模块,用于根据所述光流融合样本图像和所述语义分割标注对预设的深度学习模型进行训练,得到所述语义分割模型。
在本申请实施例的一种具体实现方式中,所述模型训练模块可以包括:
结果获取单元,用于将所述光流融合样本图像输入至所述深度学习模型,并获取所述深度学习模型的输出结果;
损失值计算单元,用于根据所述输出结果和所述语义分割标注计算所述深度学习模型的训练损失值;
参数调整单元,用于根据所述训练损失值对所述深度学习模型进行模型参数调整,得到所述语义分割模型。
在本申请实施例的一种具体实现方式中,所述损失值计算单元可以包括:
第一计算子单元,用于计算所述输出结果和所述语义分割标注之间的分割区域交并比;
第二计算子单元,用于根据所述分割区域交并比计算所述训练损失值。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置,模块和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。
图5示出了本申请实施例提供的一种机器人的示意框图,为了便于说明,仅示出了与本申请实施例相关的部分。
如图5所示,该实施例的机器人5包括:处理器50、存储器51以及存储在所述存储器51中并可在所述处理器50上运行的计算机程序52。所述处理器50执行所述计算机程序52时实现上述各个语义分割方法实施例中的步骤,例如图3所示的步骤S301至步骤S304。或者,所述处理器50执行所述计算机程序52时实现上述各装置实施例中各模块/单元的功能,例如图4所示模块401至模块404的功能。
示例性的,所述计算机程序52可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器51中,并由所述处理器50执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描 述所述计算机程序52在所述机器人5中的执行过程。
本领域技术人员可以理解,图5仅仅是机器人5的示例,并不构成对机器人5的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述机器人5还可以包括输入输出设备、网络接入设备、总线等。
所述处理器50可以是中央处理单元(Central Processing Unit,CPU),还可以是其它通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其它可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
所述存储器51可以是所述机器人5的内部存储单元,例如机器人5的硬盘或内存。所述存储器51也可以是所述机器人5的外部存储设备,例如所述机器人5上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器51还可以既包括所述机器人5的内部存储单元也包括外部存储设备。所述存储器51用于存储所述计算机程序以及所述机器人5所需的其它程序和数据。所述存储器51还可以用于暂时地存储已经输出或者将要输出的数据。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的实施例中,应该理解到,所揭露的装置/机器人和方法,可以通过其它的方式实现。例如,以上所描述的装置/机器人实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读存储介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读存储介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读存储介质不包括电载波信号和电信信号。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (10)

  1. 一种语义分割方法,其特征在于,包括:
    获取第一图像和第二图像;其中,所述第一图像为待进行语义分割的图像,所述第二图像为所述第一图像的前一帧图像;
    对所述第一图像和所述第二图像进行光流计算,得到第一光流数据;
    将所述第一光流数据与所述第一图像进行融合,得到光流融合图像;
    使用预设的语义分割模型对所述光流融合图像进行语义分割,得到与所述第一图像对应的语义分割结果。
  2. 根据权利要求1所述的语义分割方法,其特征在于,所述对所述第一图像和所述第二图像进行光流计算,得到第一光流数据,包括:
    将所述第一图像和所述第二图像输入至预设的光流模型,并获取所述光流模型的中间输出结果;其中,所述中间输出结果为所述光流模型的最终输出结果之前的光流计算结果;
    将所述中间输出结果作为所述第一光流数据。
  3. 根据权利要求1所述的语义分割方法,其特征在于,所述将所述第一光流数据与所述第一图像进行融合,得到光流融合图像,包括:
    对所述第一光流数据进行插值,得到与所述第一图像的尺寸一致的插值光流结果;
    将所述插值光流数据与所述第一图像进行融合,得到所述光流融合图像。
  4. 根据权利要求3所述的语义分割方法,其特征在于,所述将所述插值光流数据与所述第一图像进行融合,得到所述光流融合图像,包括:
    将所述插值光流结果和所述第一图像在通道维度上进行拼接,得到所述光流融合图像。
  5. 根据权利要求1至4中任一项所述的语义分割方法,其特征在于,在使用预设的语义分割模型对所述光流融合图像进行语义分割,得到与所述第一图像对应的语义分割结果之前,还包括:
    获取第一样本图像、第二样本图像和与所述第一样本图像对应的语义分割标注;其中,所述第二样本图像为所述第一样本图像的前一帧图像;
    对所述第一样本图像和所述第二样本图像进行光流计算,得到第一光流样本数据;
    将所述第一光流样本数据与所述第一样本图像进行融合,得到与所述第一样本图像对应的光流融合样本图像;
    根据所述光流融合样本图像和所述语义分割标注对预设的深度学习模型进行训练,得到所述语义分割模型。
  6. 根据权利要求5所述的语义分割方法,其特征在于,所述根据所述光流融合样本图 像和所述语义分割标注对预设的深度学习模型进行训练,得到所述语义分割模型,包括:
    将所述光流融合样本图像输入至所述深度学习模型,并获取所述深度学习模型的输出结果;
    根据所述输出结果和所述语义分割标注计算所述深度学习模型的训练损失值;
    根据所述训练损失值对所述深度学习模型进行模型参数调整,得到所述语义分割模型。
  7. 根据权利要求6所述的语义分割方法,其特征在于,所述根据所述输出结果和所述语义分割标注计算所述深度学习模型的训练损失值,包括:
    计算所述输出结果和所述语义分割标注之间的分割区域交并比;
    根据所述分割区域交并比计算所述训练损失值。
  8. 一种语义分割装置,其特征在于,包括:
    图像获取模块,用于获取第一图像和第二图像;其中,所述第一图像为待进行语义分割的图像,所述第二图像为所述第一图像的前一帧图像;
    光流计算模块,用于对所述第一图像和所述第二图像进行光流计算,得到第一光流数据;
    数据融合模块,用于将所述第一光流数据与所述第一图像进行融合,得到光流融合图像;
    语义分割模块,用于使用预设的语义分割模型对所述光流融合图像进行语义分割,得到与所述第一图像对应的语义分割结果。
  9. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至7中任一项所述的语义分割方法的步骤。
  10. 一种机器人,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至7中任一项所述的语义分割方法的步骤。
PCT/CN2023/141742 2023-06-28 2023-12-26 一种语义分割方法、装置、计算机可读存储介质及机器人 Ceased WO2025001002A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202310781685.7A CN116883656A (zh) 2023-06-28 2023-06-28 一种语义分割方法、装置、计算机可读存储介质及机器人
CN202310781685.7 2023-06-28

Publications (1)

Publication Number Publication Date
WO2025001002A1 true WO2025001002A1 (zh) 2025-01-02

Family

ID=88257820

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/141742 Ceased WO2025001002A1 (zh) 2023-06-28 2023-12-26 一种语义分割方法、装置、计算机可读存储介质及机器人

Country Status (2)

Country Link
CN (1) CN116883656A (zh)
WO (1) WO2025001002A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116883656A (zh) * 2023-06-28 2023-10-13 深圳市优必选科技股份有限公司 一种语义分割方法、装置、计算机可读存储介质及机器人
CN118279585A (zh) * 2024-03-29 2024-07-02 上海玄戒技术有限公司 视频语义分割方法、装置、电子设备、存储介质及芯片

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112862839A (zh) * 2021-02-24 2021-05-28 清华大学 一种地图要素语义分割鲁棒性增强方法和系统
US20210353393A1 (en) * 2020-05-15 2021-11-18 Retrace Labs Artificial Intelligence Platform for Determining Dental Readiness
CN114283352A (zh) * 2021-11-12 2022-04-05 北京旷视科技有限公司 一种视频语义分割装置、训练方法以及视频语义分割方法
CN116883656A (zh) * 2023-06-28 2023-10-13 深圳市优必选科技股份有限公司 一种语义分割方法、装置、计算机可读存储介质及机器人

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110889851B (zh) * 2018-09-11 2023-08-01 苹果公司 针对深度和视差估计的语义分割的稳健用途
CN111161307B (zh) * 2019-12-19 2023-04-18 深圳云天励飞技术有限公司 图像分割方法、装置、电子设备及存储介质
CN114549829B (zh) * 2020-11-20 2025-04-25 阿里巴巴集团控股有限公司 模型训练方法、服务提供方法、装置、设备和存储介质
CN113689436B (zh) * 2021-09-29 2024-02-02 平安科技(深圳)有限公司 图像语义分割方法、装置、设备及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210353393A1 (en) * 2020-05-15 2021-11-18 Retrace Labs Artificial Intelligence Platform for Determining Dental Readiness
CN112862839A (zh) * 2021-02-24 2021-05-28 清华大学 一种地图要素语义分割鲁棒性增强方法和系统
CN114283352A (zh) * 2021-11-12 2022-04-05 北京旷视科技有限公司 一种视频语义分割装置、训练方法以及视频语义分割方法
CN116883656A (zh) * 2023-06-28 2023-10-13 深圳市优必选科技股份有限公司 一种语义分割方法、装置、计算机可读存储介质及机器人

Also Published As

Publication number Publication date
CN116883656A (zh) 2023-10-13

Similar Documents

Publication Publication Date Title
CN112862685B (zh) 图像拼接的处理方法、装置和电子系统
CN113711276B (zh) 尺度感知单目定位和地图构建
KR102480245B1 (ko) 패닝 샷들의 자동 생성
CN108388882B (zh) 基于全局-局部rgb-d多模态的手势识别方法
WO2025001002A1 (zh) 一种语义分割方法、装置、计算机可读存储介质及机器人
CN110246147A (zh) 视觉惯性里程计方法、视觉惯性里程计装置及移动设备
CN107123142A (zh) 位姿估计方法和装置
CN109525786B (zh) 视频处理方法、装置、终端设备及存储介质
CN114663593B (zh) 三维人体姿态估计方法、装置、设备及存储介质
WO2024041235A1 (zh) 图像处理方法、装置、设备、存储介质及程序产品
CN114916239A (zh) 估计图像的深度和图像之间的相对摄像头位姿
KR20220080696A (ko) 깊이 추정 방법, 디바이스, 전자 장비 및 컴퓨터 판독가능 저장 매체
CN116485863A (zh) 基于数据融合的深度图像视频生成方法及装置
CN112800822A (zh) 利用结构约束和物理约束进行3d自动标记
CN117218364B (zh) 三维目标检测方法、电子设备及存储介质
US20240029472A1 (en) Depth assisted images refinement
WO2021136224A1 (zh) 图像分割方法以及图像分割装置
CN113205011A (zh) 图像掩膜确定方法及装置、存储介质和电子设备
CN115546027B (zh) 图像缝合线确定方法、装置以及存储介质
CN115482588A (zh) 一种预测三维模型的姿态的方法及电子设备
JP2014085845A (ja) 動画処理装置、動画処理方法、プログラム、および集積回路
CN110889894A (zh) 三维人脸重建方法、装置及终端设备
CN115631296A (zh) 一种3d目标检测方法、计算机程序产品及电子设备
CN115147434A (zh) 图像处理方法、装置、终端设备及计算机可读存储介质
CN118396903A (zh) 基于深度学习的手机图像畸变校正方法、装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23943473

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE