Model training method and device, drivable area detection method and device
By automatically generating the weight allocation structure of the loss function weights, the problem of relying on manual weight setting for multi-loss function collaborative optimization is solved, and the model's efficient segmentation and generalization capabilities in different scenarios are realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHENGDU TIANFU INVO TECHNOLOGY CO LTD
- Filing Date
- 2026-03-04
- Publication Date
- 2026-06-26
AI Technical Summary
In existing technologies, the collaborative optimization effect of multiple loss functions is highly dependent on manually setting weights, resulting in poor generalization ability.
The weight allocation structure is adopted to automatically generate the weights of the loss function based on the feature map. By sharing the feature map of the backbone network, the backbone network and region segmentation structure are optimized first, and then the weight allocation structure is optimized to achieve dynamic adaptation to the loss optimization needs of different scenarios.
It significantly reduces the cost of manual debugging, improves the generalization ability of the model, and ensures the segmentation accuracy and precision in different scenarios.
Smart Images

Figure CN121789185B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image recognition technology, and in particular to a model training method and apparatus, and a drivable area detection method and apparatus. Background Technology
[0002] In the field of autonomous driving, drivable area detection is a core technology for ensuring driving safety and path planning. Its core objective is to accurately identify the category of each pixel in an image through algorithms, outputting clear segmentation results to assist subsequent decision-making. With the development of deep learning technology, neural network-based image segmentation schemes have become the mainstream technology in this field due to their powerful feature extraction and fitting capabilities. To address common problems in segmentation tasks such as class imbalance, blurred edges, and multi-scale target adaptation, the industry generally adopts an optimization strategy that combines multiple loss functions. By combining various targeted loss functions, complementary optimization is achieved, improving the model's adaptability to complex scenarios.
[0003] However, the effectiveness of collaborative optimization using multiple loss functions is highly dependent on the rationality of weight allocation; the weights of the loss functions directly determine their relative importance during model training. Existing techniques typically involve manually setting weights, relying on subjective human experience and resulting in poor generalization ability. Summary of the Invention
[0004] This application is made in view of at least one of the above-mentioned technical problems existing in the prior art, and the application can improve the generalization ability of the model.
[0005] In a first aspect, embodiments of this application provide a model training method, including:
[0006] Image samples are input into the backbone network to obtain the feature map output by the backbone network;
[0007] The feature map is input into the region segmentation structure to obtain the segmentation map output by the region segmentation structure;
[0008] The feature map is input into the weight allocation structure to obtain the weights of multiple loss functions output by the weight allocation structure;
[0009] The total loss value is calculated based on each of the aforementioned loss functions and their weights, and the segmentation map.
[0010] Based on the total loss value, update the parameters of the backbone network and the parameters of the region segmentation structure;
[0011] The parameters of the backbone network and the parameters of the region segmentation structure are locked, and the parameters of the weight allocation structure are updated based on the total loss value.
[0012] Secondly, embodiments of this application provide a drivable area detection method, based on a backbone network and region segmentation structure trained using the above method, the method comprising:
[0013] The target image is input into the backbone network to obtain the target feature map output by the backbone network;
[0014] The target feature map is input into the region segmentation structure to obtain the target segmentation map output by the region segmentation structure;
[0015] Based on the target segmentation map, the drivable area in the target image is determined.
[0016] Thirdly, embodiments of this application provide a model training apparatus, including:
[0017] The first input module is configured to input image samples into a backbone network to obtain a feature map output by the backbone network; input the feature map into a region segmentation structure to obtain a segmentation map output by the region segmentation structure; and input the feature map into a weight allocation structure to obtain the weights of multiple loss functions output by the weight allocation structure.
[0018] The calculation module is configured to calculate the total loss value based on each of the loss functions and their weights, and the segmentation map;
[0019] The update module is configured to update the parameters of the backbone network and the parameters of the region segmentation structure based on the total loss value; lock the parameters of the backbone network and the parameters of the region segmentation structure, and update the parameters of the weight allocation structure based on the total loss value.
[0020] Fourthly, embodiments of this application provide a drivable area detection device, based on a trained backbone network and region segmentation structure, the device comprising:
[0021] The second input module is configured to input the target image into the backbone network to obtain the target feature map output by the backbone network; and input the target feature map into the region segmentation structure to obtain the target segmentation map output by the region segmentation structure.
[0022] The determination module is configured to determine the drivable area in the target image based on the target segmentation map.
[0023] Fifthly, embodiments of this application provide an electronic device, including a memory and a processor, wherein the memory stores an executable program, and the processor executes the executable program to perform the steps of the method as described in any of the preceding claims.
[0024] This application provides a model training method and apparatus, and a drivable region detection method and apparatus. The weight allocation structure automatically generates weights based on feature maps, eliminating the need for repeated debugging by developers and significantly reducing labor costs. The weights dynamically change with the features of the input image, adapting to the loss optimization needs of different scenarios. Compared to training with fixed weights, it can more fully leverage the synergistic advantages of multiple loss functions. The backbone network and region segmentation structure are optimized first, followed by the weight allocation structure, ensuring that the core segmentation task converges to a reasonable level first, preventing random parameters in the weight allocation structure from interfering with the optimization of the region segmentation structure in the early stages of training. The weighted fusion of multiple loss functions effectively constrains the model's learning direction. Combined with a phased update strategy, the features learned by the model become more generalizable, improving the model's generalization ability. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a flowchart of a model training method provided in one embodiment of this application;
[0027] Figure 2 This is a flowchart of a drivable area detection method provided in one embodiment of this application;
[0028] Figure 3 This is a schematic diagram of a model training device provided in one embodiment of this application;
[0029] Figure 4 This is a schematic diagram of a drivable area detection device provided in one embodiment of this application;
[0030] Figure 5 This is a schematic diagram of the structure of a model provided in one embodiment of this application. Detailed Implementation
[0031] To enable those skilled in the art to better understand the technical solutions of the embodiments of this application, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0032] like Figure 1As shown in the embodiments of this application, a model training method is provided, including:
[0033] Step 101: Input the image samples into the backbone network to obtain the feature map output by the backbone network.
[0034] The backbone network is used for feature extraction and is usually a deep convolutional neural network, such as ResNet, ConvNeXt, SegNet encoder, etc.
[0035] The backbone network performs downsampling of image samples layer by layer through multi-layer convolution and pooling operations, transforming the information in the original pixel space into feature maps in a high-dimensional semantic feature space. Low-level features contain detailed information such as edges and textures, while high-level features contain abstract semantic information such as roads and obstacles.
[0036] If the region segmentation structure and the weight allocation structure extract features independently, it will lead to redundant calculations and increase training costs. Sharing the backbone network can reduce the computational load of feature extraction. Both branches complete the task based on the same feature map, ensuring that the weights output by the weight allocation structure are effective weights for the features of the current segmentation task, and avoiding the decoupling of weights from the segmentation task due to different feature sources.
[0037] Step 102: Input the feature map into the region segmentation structure to obtain the segmentation map output by the region segmentation structure.
[0038] Region segmentation structures can employ U-Net decoders, Deeplab V3's ASPP module, etc.
[0039] The region segmentation structure restores low-resolution feature maps to the same size as the original image through transposed convolutional upsampling, skip connection feature fusion (U-Net), or multi-scale dilated convolutional fusion (DeeplabV3), and maps the number of feature channels to the number of segmentation categories. The region segmentation structure outputs pixel-level segmentation maps, with each pixel corresponding to the confidence scores of multiple categories.
[0040] This step transforms abstract semantic features into concrete pixel category scores, providing a basis for loss calculation. Through operations such as upsampling and feature fusion, it compensates for the loss of details caused by downsampling of the backbone network, ensuring the edge precision of the segmentation map.
[0041] Step 103: Input the feature map into the weight allocation structure to obtain the weights of multiple loss functions output by the weight allocation structure.
[0042] Weight allocation structures can be implemented using convolutional layers, activation functions, fully connected layers, and normalization.
[0043] Convolutional layers compress spatial features from the feature map, extracting key semantic information related to the loss weights, such as edge complexity and class imbalance. Activation functions, such as ReLU, introduce non-linearity, enhancing feature representation. Fully connected layers transform the two-dimensional feature map into a one-dimensional vector and map it to a weight vector matching the number of loss functions (e.g., three loss functions correspond to a three-dimensional weight vector). Normalization operations, such as using the Softmax function, map the weight vectors to the 0-1 range with a sum of 1, ensuring the weights have a physical meaning reflecting their relative importance. Normalization can also be a step independent of the weight allocation structure, as will be explained in subsequent examples.
[0044] like Figure 5 As shown, the model includes a backbone network, a region segmentation structure, and a weight allocation structure. The input image is in RGB format. After feature extraction by the backbone network, the feature maps are input to two branches: the region segmentation structure and the weight allocation structure. The region segmentation structure outputs a segmentation map, and the weight allocation structure outputs a loss map. The loss map includes weights for multiple loss functions, where C represents the number of channels, H represents the height, and W represents the width.
[0045] Step 104: Calculate the total loss value based on each loss function, its weights, and the segmentation map.
[0046] Substitute the segmentation map and the ground truth label map into each loss function to obtain the loss value of each loss function, and then calculate the total loss value by weighting.
[0047] Step 105: Update the parameters of the backbone network and the parameters of the region segmentation structure based on the total loss value.
[0048] The gradient descent algorithm is used to calculate the gradient of the total loss value with respect to the parameters of the backbone network and the region segmentation structure. The parameters are updated along the gradient descent direction to reduce the total loss value. During this stage, the parameters of the weight allocation structure are not updated because their role is to provide weights, not to participate in the segmentation task learning.
[0049] Step 106: Lock the parameters of the backbone network and the parameters of the region segmentation structure, and update the parameters of the weight allocation structure based on the total loss value.
[0050] Steps 101-103 are the forward propagation stage: completing shared feature extraction and dual-branch output. Step 104 is the loss calculation stage, realizing weighted fusion of multiple losses. Steps 105-106 are the backpropagation stage, first optimizing the feature extraction and segmentation tasks, and then optimizing the weight allocation task.
[0051] Calculate the gradient of the total loss value with respect to the parameters of the weight allocation structure. At this stage, the gradient only reflects the impact of weight changes on the total loss value. Update the parameters of the weight allocation structure along the gradient descent direction so that its output weights can further reduce the total loss value. During this stage, the parameters of the backbone network and the region segmentation structure are fixed to ensure that the goal of weight learning is to adapt to the segmentation task, rather than to change the learning direction of the segmentation task.
[0052] In this embodiment, the weight allocation structure automatically generates weights based on feature maps, eliminating the need for repeated debugging by developers and significantly reducing labor costs. The weights dynamically change with the features of the input image, adapting to loss optimization needs in different scenarios. Compared to training with fixed weights, this approach more fully leverages the synergistic advantages of multiple loss functions. The backbone network and region segmentation structure are optimized first, followed by the weight allocation structure, ensuring that the core segmentation task converges to a reasonable level first and preventing random parameters in the weight allocation structure from interfering with the optimization of the region segmentation structure in the early stages of training. The weighted fusion of multiple loss functions effectively constrains the model's learning direction. Combined with a phased update strategy, this makes the features learned by the model more generalizable, improving the model's generalization ability.
[0053] In one embodiment of this application, the total loss value is calculated based on each loss function and its weights, and the segmentation map, including:
[0054] Normalize the weights of each loss function;
[0055] Based on the segmentation map, calculate the loss value of each loss function;
[0056] The total loss value is calculated based on the loss value of each loss function and its corresponding normalized weight.
[0057] In this embodiment, the Softmax function can be used for normalization. The steps for calculating the total loss value can be found in the explanation of steps 103 and 104.
[0058] The original weights may vary by orders of magnitude, causing the total loss to be dominated by a single loss function. The normalized weights sum to 1, and the proportion of each weight is within a reasonable range, ensuring that each loss function can make an effective contribution to the total loss.
[0059] In one embodiment of this application, the multiple loss functions include at least two of the following: binary cross-entropy loss function (BCE Loss), Dice loss function, and boundary loss function.
[0060] BCE Loss is the basic loss function for pixel-level binary classification tasks. Its core function is to quantify the global classification error of the model for drivable / indestructible areas, and it is the most commonly used benchmark loss in segmentation tasks.
[0061] Dice Loss is a loss function based on region overlap rate. Its core function is to solve the class imbalance problem of BCE Loss and quantify the degree of overlap between the predicted region and the real region. It is especially suitable for segmentation optimization of small targets and edge regions.
[0062] Boundary Loss is a specialized loss function for edge pixels. Its core function is to quantify the model's segmentation error of the drivable region boundary, thus solving the problem that BCE Loss and Dice Loss do not pay enough attention to edge details.
[0063] Combination 1: BCE Loss + Dice Loss, which balances global classification accuracy with class imbalance optimization, and is suitable for scenarios such as unstructured rural roads and small drivable road areas. BCE Loss ensures the model's classification accuracy for the majority class, while Dice Loss forces the model to focus on minority class regions, avoiding missed detections in small areas.
[0064] Combination 2: BCE Loss + Boundary Loss, which balances global classification accuracy and edge segmentation fineness, is suitable for urban structured roads and scenarios with clear but demanding road edges. BCE Loss constrains global pixel classification, while Boundary Loss improves edge sharpness, making the segmentation results more closely match the real road boundaries.
[0065] Combination 3: BCE Loss + Dice Loss + Boundary Loss, achieves full-dimensional optimization of global, category and edge, suitable for complex low-light scenes such as rainy days and foggy days, and can solve global classification error, category imbalance and edge blurring problems at the same time.
[0066] In one embodiment of this application, the weight allocation structure includes: a convolutional layer, a first activation function layer, a fully connected layer, and a second activation function layer.
[0067] The introduction of convolutional layers allows the weight allocation structure to extract spatial information relevant to loss optimization from the semantic feature maps of the backbone network, rather than generating random weights unrelated to image content. The first activation function layer, such as ReLU, overcomes the limitations of linear transformations in convolutional layers, enabling the weight allocation structure to learn complex mappings between features and weights. The second activation function layer, also like ReLU, further optimizes the distribution of candidate weight values, allowing the weights to accurately match the loss optimization needs of different scenarios.
[0068] This application embodiment constructs a scientific and efficient weight allocation system through a four-level cascaded structure of convolution, activation, fully connected and activation. This structure not only preserves the semantic space features of the image, but also achieves accurate mapping from features to weights, while improving the adaptive capability of the weights through dual nonlinear transformations.
[0069] In one embodiment of this application, the backbone network and region segmentation structure belong to U-NET or DeeplabV3.
[0070] The U-NET encoder serves as the backbone network, while the decoder and skip connections form the region segmentation structure.
[0071] The backbone network of Deeplab V3 serves as the main network, while the ASPP module and lightweight decoder serve as the region segmentation structure.
[0072] like Figure 2 As shown, this application provides a drivable area detection method based on a backbone network and region segmentation structure trained according to any of the above embodiments. The method includes:
[0073] Step 201: Input the target image into the backbone network to obtain the target feature map output by the backbone network.
[0074] Step 202: Input the target feature map into the region segmentation structure to obtain the target segmentation map output by the region segmentation structure.
[0075] Step 203: Based on the target segmentation map, determine the drivable area in the target image.
[0076] The weight allocation structure does not participate in the computation during the inference phase. Because the model used (backbone network and region segmentation structure) is obtained through dynamic loss weight optimization and stable alternating training, it possesses stronger feature extraction capabilities and more accurate segmentation capabilities. Therefore, when applied to target images, it can more accurately distinguish roads, grass, sidewalks, obstacles, etc., maintaining high detection accuracy even under conditions of changing lighting, inclement weather, complex road structures, or occlusion.
[0077] In one embodiment of this application, determining the drivable region in a target image based on a target segmentation map includes:
[0078] The Argmax function is used to determine the category of each pixel in the target segmentation map, thus obtaining the drivable area.
[0079] This application embodiment transforms the uncertain multi-class probability distribution output by the region segmentation structure into a definite, rigid final segmentation result where each pixel has one and only one class, thereby clearly defining the boundary of the drivable area.
[0080] like Figure 3 As shown in the figure, this application embodiment provides a model training apparatus, including:
[0081] The first input module 301 is configured to input image samples into the backbone network to obtain the feature map output by the backbone network; input the feature map into the region segmentation structure to obtain the segmentation map output by the region segmentation structure; and input the feature map into the weight allocation structure to obtain the weights of multiple loss functions output by the weight allocation structure.
[0082] The calculation module 302 is configured to calculate the total loss value based on each loss function and its weights, and the segmentation map;
[0083] The update module 303 is configured to update the parameters of the backbone network and the parameters of the region segmentation structure based on the total loss value; lock the parameters of the backbone network and the parameters of the region segmentation structure, and update the parameters of the weight allocation structure based on the total loss value.
[0084] In one embodiment of this application, the calculation module 302 is configured to normalize the weights of each loss function; calculate the loss value of each loss function based on the segmentation map; and calculate the total loss value based on the loss value of each loss function and its corresponding normalized weights.
[0085] like Figure 4 As shown, this application provides a drivable area detection device based on a backbone network and region segmentation structure trained according to any of the above embodiments. The device includes:
[0086] The second input module 401 is configured to input the target image into the backbone network to obtain the target feature map output by the backbone network; and to input the target feature map into the region segmentation structure to obtain the target segmentation map output by the region segmentation structure.
[0087] The determination module 402 is configured to determine the drivable area in the target image based on the target segmentation map.
[0088] This application provides an electronic device, including a memory and a processor. The memory stores an executable program, and the processor executes the executable program to perform the steps of the methods described in any of the above embodiments.
[0089] This application provides a computer program product that, when executed by a processor, implements the methods of any of the above embodiments.
[0090] It should be understood that in the embodiments of this application, the processor may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0091] It should also be understood that the memory mentioned in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Specifically, non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
[0092] It should be noted that when the processor is a general-purpose processor, DSP, ASIC, FPGA, or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, the memory (storage module) is integrated into the processor.
[0093] It should be noted that the memories described herein are intended to include, but are not limited to, these and any other suitable types of memories.
[0094] In addition to the data bus, this bus may also include a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled "bus" in the diagram.
[0095] It should also be understood that the first, second, third, fourth and various numerical designations used herein are merely for descriptive convenience and are not intended to limit the scope of this application.
[0096] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0097] In implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software. The steps of the method disclosed in the embodiments of this application can be directly implemented by a hardware processor, or by a combination of hardware and software modules in the processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, detailed descriptions are omitted here.
[0098] In the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0099] Those skilled in the art will recognize that the various illustrative logical blocks (ILBs) and steps described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.
[0100] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0101] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0102] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0103] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.
[0104] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A model training method, characterized in that, include: Image samples are input into the backbone network to obtain the feature map output by the backbone network; The feature map is input into the region segmentation structure to obtain the segmentation map output by the region segmentation structure; The feature map is input into the weight allocation structure so that the weight allocation structure extracts spatial information related to loss optimization from the feature map, and obtains the weights of multiple loss functions output by the weight allocation structure. The total loss value is calculated based on each of the aforementioned loss functions and their weights, and the segmentation map. Based on the total loss value, update the parameters of the backbone network and the parameters of the region segmentation structure; Lock the parameters of the backbone network and the parameters of the region segmentation structure, and update the parameters of the weight allocation structure based on the total loss value; The weight allocation structure includes: a convolutional layer, a first activation function layer, a fully connected layer, and a second activation function layer.
2. The method as described in claim 1, characterized in that, Based on the various loss functions and their weights, and the segmentation map, the total loss value is calculated, including: The weights of each loss function are normalized; Based on the segmentation map, the loss value of each loss function is calculated; The total loss value is calculated based on the loss value of each loss function and its corresponding normalized weight.
3. The method as described in claim 1, characterized in that, The plurality of loss functions include at least two of the following: binary cross-entropy loss function, Desce loss function, and boundary loss function.
4. The method as described in claim 1, characterized in that, in, The backbone network and the region segmentation structure belong to U-Net or Deeplab V3.
5. A method for detecting drivable areas, characterized in that, Based on the backbone network and region segmentation structure trained using any one of the model training methods of claims 1-4, the method includes: The target image is input into the backbone network to obtain the target feature map output by the backbone network; The target feature map is input into the region segmentation structure to obtain the target segmentation map output by the region segmentation structure; Based on the target segmentation map, the drivable area in the target image is determined.
6. The method as described in claim 5, characterized in that, Based on the target segmentation map, determining the drivable region in the target image includes: The category of each pixel in the target segmentation map is determined based on the Argmax function, and the drivable area is obtained.
7. A model training device, characterized in that, include: The first input module is configured to input image samples into the backbone network to obtain the feature map output by the backbone network; The feature map is input into a region segmentation structure to obtain a segmentation map output by the region segmentation structure; the feature map is input into a weight allocation structure so that the weight allocation structure extracts spatial information related to loss optimization from the feature map to obtain the weights of multiple loss functions output by the weight allocation structure. The calculation module is configured to calculate the total loss value based on each of the loss functions and their weights, and the segmentation map; The update module is configured to update the parameters of the backbone network and the parameters of the region segmentation structure based on the total loss value; Lock the parameters of the backbone network and the parameters of the region segmentation structure, and update the parameters of the weight allocation structure based on the total loss value; The weight allocation structure includes: a convolutional layer, a first activation function layer, a fully connected layer, and a second activation function layer.
8. A drivable area detection device, characterized in that, Based on the backbone network and region segmentation structure trained using any one of the model training methods of claims 1-4, the device comprises: The second input module is configured to input the target image into the backbone network to obtain the target feature map output by the backbone network; and input the target feature map into the region segmentation structure to obtain the target segmentation map output by the region segmentation structure. The determination module is configured to determine the drivable area in the target image based on the target segmentation map.
9. An electronic device comprising a memory and a processor, characterized in that, The memory stores an executable program, and the processor executes the executable program to perform the steps of the method as described in any one of claims 1 to 6.