Target segmentation model testing method and device, readable storage medium and electronic equipment
Patent Information
- Application Number
- CN202611117764.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-24
- Publication Date
- 2026-10-23
AI Technical Summary
[0004]有鉴于此,本申请实施例提供了一种目标分割模型测试方法、装置、计算机可读存储介质及电子设备,以解决目标分割模型在进行实际测试时的性能较差的问题
[0021]本申请实施例的第五方面提供了一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行上述任一种目标分割模型测试方法的步骤。
Smart Images

Figure CN122967068A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of target segmentation technology, and in particular relates to a target segmentation model testing method, apparatus, computer-readable storage medium and electronic device. Background Technology
[0002] With the rapid advancement of embodied intelligence technology and deep learning visual perception algorithms, humanoid robots are playing an increasingly important role in tasks such as handling, stacking, sorting, and warehousing logistics. To achieve stable grasping and precise manipulation in complex environments, robots must possess high-precision perception and segmentation capabilities for boxes (such as bins and cartons). Through accurate contour extraction and region separation of the target box using segmentation algorithms, the robot can further perform key operations such as grasping and positioning, posture estimation, and obstacle avoidance, thereby ensuring the reliability and safety of the overall handling task.
[0003] Currently, lightweight object segmentation models have become the mainstream choice for edge-side box perception tasks due to their compact structure and fast inference speed. However, the training set of object segmentation models usually consists mainly of normally exposed images, while the actual testing environment has large differences in lighting conditions, often including backlighting, low light, and reflections, resulting in poor performance of object segmentation models in actual tests. Summary of the Invention
[0004] In view of this, embodiments of this application provide a target segmentation model testing method, apparatus, computer-readable storage medium, and electronic device to solve the problem of poor performance of target segmentation models during actual testing.
[0005] A first aspect of this application provides a method for testing a target segmentation model, which may include: The test sample image is segmented using a trained target segmentation model to obtain the first target segmentation result. The test sample image is subjected to illumination enhancement processing to obtain a test enhanced image corresponding to the test sample image; The trained target segmentation model is used to perform target segmentation processing on the test enhanced image to obtain a second target segmentation result. The first target segmentation result and the second target segmentation result are fused to obtain a fused target segmentation result.
[0006] In one specific implementation of the first aspect, before performing target segmentation processing on the test sample image using a trained target segmentation model to obtain the first target segmentation result, the following may be included: The initial target segmentation model is enhanced and trained based on the bidirectional illumination enhancement training mechanism to obtain the trained target segmentation model. The bidirectional illumination enhancement training mechanism includes forward illumination enhancement and reverse illumination enhancement of the training sample image. Forward illumination enhancement is used to increase the brightness of the training sample image, and reverse illumination enhancement is used to decrease the brightness of the training sample image.
[0007] In one specific implementation of the first aspect, the step of enhancing the initial target segmentation model based on the bidirectional illumination enhancement training mechanism to obtain the trained target segmentation model may include: The current illumination enhancement mode is determined based on the preset activation probability of the illumination enhancement mode; wherein, the current illumination enhancement mode is either forward illumination enhancement or reverse illumination enhancement. The training sample image is subjected to illumination enhancement processing according to the current illumination enhancement mode to obtain a training enhanced image corresponding to the training sample image. The initial target segmentation model is enhanced and trained based on the training sample images and the enhanced training images to obtain the trained target segmentation model.
[0008] In one specific implementation of the first aspect, the step of performing illumination enhancement processing on the training sample image according to the current illumination enhancement mode to obtain a training enhanced image corresponding to the training sample image may include: When the current illumination enhancement mode is positive illumination enhancement, the training sample image is positively illuminated to obtain the training enhanced image corresponding to the training sample image; When the current illumination enhancement mode is reverse illumination enhancement, reverse illumination enhancement is performed on the training sample image to obtain the training enhanced image corresponding to the training sample image.
[0009] In one specific implementation of the first aspect, the fusion processing of the first target segmentation result and the second target segmentation result to obtain a fused target segmentation result may include: The first target segmentation result and the second target segmentation result are combined to obtain the fused target segmentation result.
[0010] In one specific implementation of the first aspect, after performing a union calculation on the first target segmentation result and the second target segmentation result to obtain the fused target segmentation result, the method may further include: Overlapping target detection is performed in the fused target segmentation result; If overlapping targets are detected, the detected overlapping targets are merged into a single physical target; wherein, the overlapping targets are different targets whose cross-union ratio of the target detection boxes is greater than a preset cross-union ratio threshold.
[0011] In one specific implementation of the first aspect, it may also include: Obtain the image to be segmented; The trained target segmentation model is used to perform target segmentation processing on the image to be segmented, and the target segmentation result of the image to be segmented is obtained.
[0012] A second aspect of this application provides a target segmentation model testing apparatus, which may include: The test sample image processing module is used to perform target segmentation processing on the test sample image using a trained target segmentation model to obtain the first target segmentation result. An image illumination enhancement processing module is used to perform illumination enhancement processing on the test sample image to obtain a test enhanced image corresponding to the test sample image; The test enhancement image processing module is used to perform target segmentation processing on the test enhancement image using the trained target segmentation model to obtain a second target segmentation result; The segmentation result fusion processing module is used to fuse the first target segmentation result and the second target segmentation result to obtain a fused target segmentation result.
[0013] In one specific implementation of the second aspect, the target segmentation model testing device may further include: A bidirectional illumination enhancement training module is used to enhance the initial target segmentation model based on a bidirectional illumination enhancement training mechanism to obtain the trained target segmentation model; wherein, the bidirectional illumination enhancement training mechanism includes forward illumination enhancement and reverse illumination enhancement of the training sample image, the forward illumination enhancement is used to increase the brightness of the training sample image, and the reverse illumination enhancement is used to decrease the brightness of the training sample image.
[0014] In one specific implementation of the second aspect, the bidirectional illumination enhancement training module may include: An enhancement mode determination unit is used to determine the current illumination enhancement mode based on a preset illumination enhancement mode activation probability; wherein the current illumination enhancement mode is either forward illumination enhancement or reverse illumination enhancement. The illumination enhancement processing unit is used to perform illumination enhancement processing on the training sample image according to the current illumination enhancement mode to obtain a training enhanced image corresponding to the training sample image. An enhancement training unit is used to enhance the initial target segmentation model based on the training sample images and the enhanced training images to obtain the trained target segmentation model.
[0015] In one specific implementation of the second aspect, the illumination enhancement processing unit may be specifically used to: perform forward illumination enhancement on the training sample image when the current illumination enhancement mode is forward illumination enhancement, to obtain the training enhanced image corresponding to the training sample image; and perform reverse illumination enhancement on the training sample image when the current illumination enhancement mode is reverse illumination enhancement, to obtain the training enhanced image corresponding to the training sample image.
[0016] In one specific implementation of the second aspect, the segmentation result fusion processing module may include: The union calculation unit is used to perform union calculation on the first target segmentation result and the second target segmentation result to obtain the fused target segmentation result.
[0017] In one specific implementation of the second aspect, the segmentation result fusion processing module may further include: An overlapping target fusion unit is used to detect overlapping targets in the fused target segmentation result; when overlapping targets are detected, the detected overlapping targets are fused into the same physical target; wherein, the overlapping targets are different targets whose cross-union ratio of the target detection boxes is greater than a preset cross-union ratio threshold.
[0018] In one specific implementation of the second aspect, the target segmentation model testing device may further include: The image to be segmented acquisition module is used to acquire the image to be segmented; The target segmentation processing module is used to perform target segmentation processing on the image to be segmented using the trained target segmentation model, so as to obtain the target segmentation result of the image to be segmented.
[0019] A third aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the above-described target segmentation model testing methods.
[0020] A fourth aspect of this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the target segmentation model testing methods described above.
[0021] The fifth aspect of this application provides a computer program product that, when run on an electronic device, causes the electronic device to perform the steps of any of the target segmentation model testing methods described above.
[0022] The beneficial effects of this application embodiment compared with the prior art are as follows: This application embodiment performs target segmentation processing on the test sample image using a trained target segmentation model to obtain a first target segmentation result; performs illumination enhancement processing on the test sample image to obtain a test enhanced image corresponding to the test sample image; performs target segmentation processing on the test enhanced image using the trained target segmentation model to obtain a second target segmentation result; and performs fusion processing on the first target segmentation result and the second target segmentation result to obtain a fused target segmentation result. In this application embodiment, during the testing phase, the trained target segmentation model can be used to perform target segmentation on the original test sample image and the illuminated enhanced test image respectively, and the final target segmentation result can be obtained by fusing the target segmentation results of the two. This can better adapt to various complex lighting conditions and effectively improve the performance of the target segmentation model in actual testing. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the 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.
[0024] Figure 1 This is a flowchart of one embodiment of a target segmentation model testing method in this application. Figure 2 This is a comparison image showing the effect of illumination enhancement processing on the test sample image before and after processing. Figure 3 Example image of the target segmentation result; Figure 4 This is a structural diagram of one embodiment of a target segmentation model testing device according to the present application. Figure 5 This is a schematic block diagram of an electronic device according to an embodiment of this application. Detailed Implementation
[0025] To make the inventive objectives, features, and advantages of this application more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0026] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0027] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0028] It should also be further understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0029] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [the described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [the described condition or event] is detected," or "in response to detection of [the described condition or event]."
[0030] Furthermore, in the description of this application, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0031] With the rapid advancement of embodied intelligence technology and deep learning visual perception algorithms, humanoid robots are playing an increasingly important role in tasks such as handling, stacking, sorting, and warehousing logistics. To achieve stable grasping and precise manipulation in complex environments, robots must possess high-precision perception and segmentation capabilities for boxes (such as bins and cartons). Through accurate contour extraction and region separation of the target box using segmentation algorithms, the robot can further perform key operations such as grasping and positioning, posture estimation, and obstacle avoidance, thereby ensuring the reliability and safety of the overall handling task.
[0032] Currently, lightweight object segmentation models have become the mainstream choice for edge-side box perception tasks due to their compact structure and fast inference speed. However, the training set of object segmentation models usually consists mainly of normally exposed images, while the actual testing environment has large differences in lighting conditions, often including backlighting, low light, and reflections, resulting in poor performance of object segmentation models in actual tests.
[0033] In view of this, embodiments of this application provide a method, apparatus, computer-readable storage medium, and electronic device for testing target segmentation models, to address the problem of poor performance of target segmentation models during practical testing. In these embodiments, during the testing phase, a trained target segmentation model can be used to segment the original test sample image and the illuminated enhanced test image separately. The final target segmentation result is obtained by fusing the segmentation results from both, thereby better adapting to various complex lighting conditions and effectively improving the performance of the target segmentation model during practical testing.
[0034] The execution subject of this application embodiment can be an electronic device, including but not limited to mobile phones, tablets, desktop computers, laptops, PDAs, robot vacuums, robots, and servers. It should be noted that the electronic device used for model training and the electronic device used for model testing can be the same electronic device or different electronic devices. That is, the model can be trained in one electronic device and then deployed to another electronic device for model testing.
[0035] Please see Figure 1 One embodiment of a target segmentation model testing method in this application may include: Step S101: Perform target segmentation processing on the test sample image using the trained target segmentation model to obtain the first target segmentation result.
[0036] The target segmentation model can be flexibly configured according to actual conditions, and may include, but is not limited to, YOLO, EfficientDet, RetinaNet, or other models. Considering the limited computing resources and real-time response requirements of humanoid robots in actual deployment environments, in one specific implementation of this application, the lightweight YOLOv8-S-Seg model can be selected as the target segmentation model. By fully training on a multi-scenario training dataset covering boxes such as tote boxes and cartons, the model is ensured to have high accuracy and high robustness in box detection and segmentation tasks.
[0037] The first target segmentation result can include a set of bounding boxes (bboxes), a set of corresponding segmentation masks, and a set of corresponding class confidence scores. That is: ,in, The first target segmentation result, For the set of object detection boxes, For the corresponding set of segmentation masks, This is the set of confidence scores for the corresponding categories.
[0038] Step S102: Perform illumination enhancement processing on the test sample image to obtain a test enhanced image corresponding to the test sample image.
[0039] In one specific implementation of this application, the test sample image can be enhanced by adjusting the gamma (gamma) to obtain a corresponding enhanced test image. The specific value of the gamma coefficient γ can be flexibly set according to actual conditions. Since the goal during testing is to increase the brightness of the test sample image, the gamma coefficient γ can be set to less than 1 to simulate the brightening and restoration effect in low-light environments, allowing the model to learn texture details in bright areas.
[0040] Figure 2 The image shows a comparison of the test sample image before and after illumination enhancement processing. The left image is the test sample image in a backlit scene, where the backlit part of the box is dark. The right image is the corresponding enhanced test image, where the dark parts of the box are significantly brightened and become clearer.
[0041] Step S103: Perform target segmentation processing on the test enhancement image using the trained target segmentation model to obtain the second target segmentation result.
[0042] The second target segmentation result can include a set of target detection boxes, a set of corresponding segmentation masks, and a set of corresponding class confidence scores. That is: ,in, The result of the second target segmentation. For the set of object detection boxes, For the corresponding set of segmentation masks, This is the set of confidence scores for the corresponding categories.
[0043] Step S104: Perform a fusion process on the first target segmentation result and the second target segmentation result to obtain a fused target segmentation result.
[0044] In one specific implementation of this application, the first target segmentation result and the second target segmentation result can be combined to obtain a fused target segmentation result. This method ensures that all valid targets detected by the target segmentation model under different lighting conditions are retained, avoiding target omissions caused by a single lighting condition.
[0045] In one specific implementation of this application, after obtaining the fusion target segmentation result, further overlapping target fusion processing can be performed on it.
[0046] Specifically, overlapping target detection can be performed in the fused target segmentation results. Overlapping targets are different targets whose detection bounding boxes have an Intersection over Union (IoU) ratio greater than a preset IoU threshold. The specific value of the IoU threshold can be flexibly set according to actual conditions, and this application embodiment does not impose a specific limitation on it. As an example, the IoU threshold can be set to 0.5 or other values.
[0047] When overlapping targets are detected, they can be fused into a single physical target. Specifically, a weighted average of the class confidence scores of the overlapping targets can be performed to obtain the fused class confidence score. At the same time, pixel-level or coordinate-level averaging can be performed on the target detection boxes and segmentation masks of the overlapping targets to smooth the boundaries and enhance the consistency of the target contours, thereby obtaining the fused target detection boxes and segmentation masks.
[0048] Based on the above process, during the testing phase, the trained target segmentation model can be used to segment the original test sample image and the test enhanced image after illumination enhancement processing, respectively. The final target segmentation result is obtained by fusing the target segmentation results of the two, which can better adapt to various complex lighting conditions and effectively improve the performance of the target segmentation model in actual testing.
[0049] It should be noted that the above processes are all optimization measures in the testing phase. In a specific implementation of this application embodiment, the model can also be enhanced during the training phase to improve the robustness of the model under different lighting scenarios.
[0050] Specifically, during the training phase, the initial target segmentation model can be enhanced by a bidirectional illumination enhancement training mechanism to obtain a trained target segmentation model.
[0051] The bidirectional illumination enhancement training mechanism includes forward illumination enhancement and reverse illumination enhancement of the training sample images. Forward illumination enhancement increases the brightness of the training sample images, with a gamma coefficient γ less than 1, thus simulating the brightening and restoration effect in low-light environments, allowing the model to learn texture details in bright areas. Reverse illumination enhancement decreases the brightness of the training sample images, with a gamma coefficient γ greater than 1, thus darkening the images to simulate backlighting or underexposure, allowing the model to learn the structural features of dark areas.
[0052] Two illumination enhancement modes can be randomly activated during training based on preset activation probabilities. The specific values of the activation probabilities can be flexibly set according to actual conditions, and this embodiment does not impose specific limitations on this. As an example, the activation probabilities of the two illumination enhancement modes can be set to the same value, 50%, or the activation probabilities of the two illumination enhancement modes can be set to different values.
[0053] In each illumination enhancement process, the current illumination enhancement mode can be determined based on the activation probability of the illumination enhancement mode, and the training sample image can be illuminated according to the current illumination enhancement mode to obtain the training enhanced image corresponding to the training sample image.
[0054] The current illumination enhancement mode can be either forward illumination enhancement or reverse illumination enhancement. When the current illumination enhancement mode is forward illumination enhancement, the training sample image can be enhanced forward to obtain a corresponding enhanced training image (brightness increase), and its corresponding gamma coefficient γ can be randomly sampled within a predetermined range less than 1. When the current illumination enhancement mode is reverse illumination enhancement, the training sample image can be enhanced in reverse to obtain a corresponding enhanced training image (brightness decrease), and its corresponding gamma coefficient γ can be randomly sampled within a predetermined range greater than 1.
[0055] After obtaining the enhanced training images, the initial target segmentation model can be further trained based on the training sample images and the enhanced training images to obtain a trained target segmentation model. In this way, the model can be exposed to both brighter and darker samples during the training phase, fully adapting to different illumination degradation distributions, thereby learning robust feature representations under inconsistent illumination scenarios and enabling it to have stronger generalization ability in real-world environments.
[0056] After obtaining the trained target segmentation model, it can be used for actual target segmentation. Specifically, the image to be segmented can be acquired, and the trained target segmentation model can be used to perform target segmentation processing on the image to be segmented, thereby obtaining the target segmentation result of the image to be segmented. Figure 3 The image shown is an example of the target segmentation result. The target segmentation result may include, but is not limited to, box category (such as box_top, box_front, etc.), confidence score, detection box position, and corresponding target segmentation mask.
[0057] In summary, the embodiments of this application effectively expand the model's illumination distribution perception range during the training phase through bidirectional illumination enhancement, enabling the model to adapt to complex environments such as changes in brightness and uneven exposure. During the testing phase, dual-input inference and result fusion of the original and enhanced images significantly improve the model's detection and segmentation stability under different illumination conditions. The resulting target segmentation model maintains high confidence output and continuous, complete mask predictions even in degraded scenarios such as low light, backlight, and reflection, thereby significantly improving the box recognition accuracy and environmental robustness of humanoid robots in real industrial environments, ensuring reliable perception capabilities in handling and positioning tasks.
[0058] It should be understood that the sequence number of each step in the above embodiments 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.
[0059] Corresponding to the target segmentation model testing method described in the above embodiments, Figure 4 This diagram illustrates a structural diagram of an embodiment of a target segmentation model testing device provided in this application.
[0060] In this embodiment, a target segmentation model testing device may include: The test sample image processing module 401 is used to perform target segmentation processing on the test sample image using a trained target segmentation model to obtain the first target segmentation result. The image illumination enhancement processing module 402 is used to perform illumination enhancement processing on the test sample image to obtain a test enhanced image corresponding to the test sample image; The test enhancement image processing module 403 is used to perform target segmentation processing on the test enhancement image using the trained target segmentation model to obtain a second target segmentation result; The segmentation result fusion processing module 404 is used to fuse the first target segmentation result and the second target segmentation result to obtain a fused target segmentation result.
[0061] In one specific implementation of this application embodiment, the target segmentation model testing device may further include: A bidirectional illumination enhancement training module is used to enhance the initial target segmentation model based on a bidirectional illumination enhancement training mechanism to obtain the trained target segmentation model; wherein, the bidirectional illumination enhancement training mechanism includes forward illumination enhancement and reverse illumination enhancement of the training sample image, the forward illumination enhancement is used to increase the brightness of the training sample image, and the reverse illumination enhancement is used to decrease the brightness of the training sample image.
[0062] In one specific implementation of this application embodiment, the bidirectional illumination enhancement training module may include: An enhancement mode determination unit is used to determine the current illumination enhancement mode based on a preset illumination enhancement mode activation probability; wherein the current illumination enhancement mode is either forward illumination enhancement or reverse illumination enhancement. The illumination enhancement processing unit is used to perform illumination enhancement processing on the training sample image according to the current illumination enhancement mode to obtain a training enhanced image corresponding to the training sample image. An enhancement training unit is used to enhance the initial target segmentation model based on the training sample images and the enhanced training images to obtain the trained target segmentation model.
[0063] In one specific implementation of this application embodiment, the illumination enhancement processing unit may be specifically used to: perform forward illumination enhancement on the training sample image when the current illumination enhancement mode is forward illumination enhancement, to obtain the training enhanced image corresponding to the training sample image; and perform reverse illumination enhancement on the training sample image when the current illumination enhancement mode is reverse illumination enhancement, to obtain the training enhanced image corresponding to the training sample image.
[0064] In one specific implementation of this application embodiment, the segmentation result fusion processing module may include: The union calculation unit is used to perform union calculation on the first target segmentation result and the second target segmentation result to obtain the fused target segmentation result.
[0065] In one specific implementation of this application embodiment, the segmentation result fusion processing module may further include: An overlapping target fusion unit is used to detect overlapping targets in the fused target segmentation result; when overlapping targets are detected, the detected overlapping targets are fused into the same physical target; wherein, the overlapping targets are different targets whose cross-union ratio of the target detection boxes is greater than a preset cross-union ratio threshold.
[0066] In one specific implementation of this application embodiment, the target segmentation model testing device may further include: The image to be segmented acquisition module is used to acquire the image to be segmented; The target segmentation processing module is used to perform target segmentation processing on the image to be segmented using the trained target segmentation model, so as to obtain the target segmentation result of the image to be segmented.
[0067] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0068] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0069] Figure 5 A schematic block diagram of an electronic device provided in an embodiment of this application is shown. For ease of explanation, only the parts related to the embodiment of this application are shown.
[0070] like Figure 5 As shown, the electronic device 5 in 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. When the processor 50 executes the computer program 52, it implements the steps in the various target segmentation model testing method embodiments described above, for example... Figure 1 Steps S101 to S104 are shown. Alternatively, when the processor 50 executes the computer program 52, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 4 The functions of modules 401 to 404 are shown.
[0071] For example, 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 this application. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program 52 in the electronic device 5.
[0072] The electronic device 5 may include, but is not limited to, computing devices such as mobile phones, tablets, desktop computers, laptops, handheld computers, robots, and servers. Those skilled in the art will understand that... Figure 5 This is merely an example of electronic device 5 and does not constitute a limitation on electronic device 5. It may include more or fewer components than shown, or combine certain components, or different components. For example, electronic device 5 may also include input / output devices, network access devices, buses, etc.
[0073] The processor 50 can be a central processing unit (CPU), or 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. The general-purpose processor can be a microprocessor or any conventional processor.
[0074] The memory 51 can be an internal storage unit of the electronic device 5, such as a hard disk or memory. The memory 51 can also be an external storage device of the electronic device 5, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory 51 can include both internal and external storage units of the electronic device 5. The memory 51 is used to store the computer program and other programs and data required by the electronic device 5. The memory 51 can also be used to temporarily store data that has been output or will be output.
[0075] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to 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 embodiments 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. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0076] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0077] Those skilled in the art will recognize that the units and algorithm steps of the various examples 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 implementation should not be considered beyond the scope of this application.
[0078] In the embodiments provided in this application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or 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 devices or units may be electrical, mechanical, or other forms.
[0079] 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.
[0080] Furthermore, 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. The integrated unit can be implemented in hardware or as a software functional unit.
[0081] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable storage medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc. It should be noted that the content included in the computer-readable storage medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable storage medium does not include electrical carrier signals and telecommunication signals.
[0082] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for testing a target segmentation model, characterized in that, include: The test sample image is segmented using a trained target segmentation model to obtain the first target segmentation result. The test sample image is subjected to illumination enhancement processing to obtain a test enhanced image corresponding to the test sample image; The trained target segmentation model is used to perform target segmentation processing on the test enhanced image to obtain a second target segmentation result. The first target segmentation result and the second target segmentation result are fused to obtain a fused target segmentation result.
2. The target segmentation model testing method according to claim 1, characterized in that, Before performing target segmentation processing on the test sample image using the trained target segmentation model to obtain the first target segmentation result, the process also includes: The initial target segmentation model is enhanced and trained based on the bidirectional illumination enhancement training mechanism to obtain the trained target segmentation model. The bidirectional illumination enhancement training mechanism includes forward illumination enhancement and reverse illumination enhancement of the training sample image. Forward illumination enhancement is used to increase the brightness of the training sample image, and reverse illumination enhancement is used to decrease the brightness of the training sample image.
3. The target segmentation model testing method according to claim 2, characterized in that, The method of enhancing the initial target segmentation model based on the bidirectional illumination enhancement training mechanism to obtain the trained target segmentation model includes: The current illumination enhancement mode is determined based on the preset activation probability of the illumination enhancement mode; wherein, the current illumination enhancement mode is either forward illumination enhancement or reverse illumination enhancement. The training sample image is subjected to illumination enhancement processing according to the current illumination enhancement mode to obtain a training enhanced image corresponding to the training sample image. The initial target segmentation model is enhanced and trained based on the training sample images and the enhanced training images to obtain the trained target segmentation model.
4. The target segmentation model testing method according to claim 3, characterized in that, The step of performing illumination enhancement processing on the training sample image according to the current illumination enhancement mode to obtain a training enhanced image corresponding to the training sample image includes: When the current illumination enhancement mode is positive illumination enhancement, the training sample image is positively illuminated to obtain the training enhanced image corresponding to the training sample image; When the current illumination enhancement mode is reverse illumination enhancement, reverse illumination enhancement is performed on the training sample image to obtain the training enhanced image corresponding to the training sample image.
5. The target segmentation model testing method according to claim 1, characterized in that, The step of fusing the first target segmentation result and the second target segmentation result to obtain a fused target segmentation result includes: The first target segmentation result and the second target segmentation result are combined to obtain the fused target segmentation result.
6. The target segmentation model testing method according to claim 5, characterized in that, After performing a union calculation on the first target segmentation result and the second target segmentation result to obtain the fused target segmentation result, the method further includes: Overlapping target detection is performed in the fused target segmentation result; If overlapping targets are detected, the detected overlapping targets are merged into a single physical target; wherein, the overlapping targets are different targets whose cross-union ratio of the target detection boxes is greater than a preset cross-union ratio threshold.
7. The target segmentation model testing method according to any one of claims 1 to 6, characterized in that, Also includes: Obtain the image to be segmented; The trained target segmentation model is used to perform target segmentation processing on the image to be segmented, and the target segmentation result of the image to be segmented is obtained.
8. A target segmentation model testing device, characterized in that, include: The test sample image processing module is used to perform target segmentation processing on the test sample image using a trained target segmentation model to obtain the first target segmentation result. An image illumination enhancement processing module is used to perform illumination enhancement processing on the test sample image to obtain a test enhanced image corresponding to the test sample image; The test enhancement image processing module is used to perform target segmentation processing on the test enhancement image using the trained target segmentation model to obtain a second target segmentation result; The segmentation result fusion processing module is used to fuse the first target segmentation result and the second target segmentation result to obtain a fused target segmentation result.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the target segmentation model testing method as described in any one of claims 1 to 7.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the target segmentation model testing method as described in any one of claims 1 to 7.