Automatic wiring cable segmentation method based on hybrid expert model
By integrating the hybrid expert model MoE into the PP-LiteSeg encoding and decoding architecture, the most relevant expert is dynamically selected for cable segmentation, which solves the problem of insufficient cable segmentation accuracy and achieves efficient feature extraction and segmentation.
Patent Information
- Application Number
- CN202511464397.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-14
- Publication Date
- 2026-01-20
AI Technical Summary
Existing cable segmentation technology based on 2D cameras under natural light is difficult to accurately segment in complex backgrounds, with varying lighting and significant differences in cable specifications, resulting in insufficient segmentation accuracy.
An automatic cable segmentation method based on a hybrid expert model is adopted. The hybrid expert model MoE is integrated using the PP-LiteSeg encoding and decoding architecture. By sharing the work of experts and routing experts, and combining the TOP-1 gating strategy and load balancing loss function, the most relevant experts are dynamically selected for feature extraction and processing.
It improves segmentation accuracy, enhances inference timeliness, reduces computational load, and strengthens the model's adaptability to complex tasks.
Smart Images

Figure CN121366288A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application discloses an automatic cable segmentation method based on a mixed expert model, and relates to the fields of computer vision and deep learning. BACKGROUND
[0002] The cable segmentation technology based on a 2D camera under natural light faces multiple technical challenges in actual application: firstly, the industrial site environment is complex, and cables often coexist with background colors, resulting in insufficient contrast between the target region and the background, so that existing segmentation algorithms cannot accurately distinguish the boundary; secondly, variable lighting conditions such as environmental light interference and light reflection phenomenon can cause image overexposure or loss of details, further increasing the difficulty of segmentation; in addition, the specifications of cables are significantly different, such as diameter, material and color, so that a single feature model cannot adapt to diversified samples and is prone to feature confusion. SUMMARY
[0003] The application provides an automatic cable segmentation method based on a mixed expert model, which guarantees segmentation accuracy and improves reasoning timeliness.
[0004] The specific scheme provided by the application is as follows:
[0005] The application provides an automatic cable segmentation method based on a mixed expert model, which is based on a PP-LiteSeg coding and decoding architecture and constructs a mixed expert model MoE, wherein the mixed expert model MoE is integrated into an encoder and a decoder of the PP-LiteSeg coding and decoding architecture: in the PP-LiteSeg coding and decoding architecture block, the mixed expert model MoE is deployed to replace a convolution layer at a pooling layer / upsampling layer as a demarcation point, the mixed expert model MoE includes a shared expert and a plurality of routing experts, the shared expert is used as a general feature extractor for all input samples to capture basic features and perform basic processing on various input samples, the routing experts are specialized and divided, so that each routing expert focuses on specific feature processing or processing of a subtask, a TOP-1 gating strategy is adopted, and a gating network is used to activate one most relevant expert according to an input sample, so as to extract or process features.
[0006] The mixed expert model MoE is trained by collecting cable image,
[0007] The mixed expert model MoE of the encoder in the PP-LiteSeg coding and decoding architecture is used to extract multi-scale feature maps of the cable image, and the mixed expert model MoE of the decoder in the PP-LiteSeg coding and decoding architecture is used to fuse the feature maps of each scale and restore the resolution, so as to output a final segmentation map of the cable.
[0008] Further, the method comprises the following steps: 4000 images of the cable are collected to form a data set, the resolution of the original cable image is 1920*1080, the network input is 1024*512, and the data set is divided into a training set, a verification set and a test set according to a ratio of 8:1:1.
[0009] Further, the method comprises the following steps: 4000 images of the cable are collected to form a data set, the resolution of the original cable image is 1920*1080, the network input is 1024*512, and the data set is divided into a training set, a verification set and a test set according to a ratio of 8:1:1.
[0010] Further, the method comprises the following steps: 4000 images of the cable are collected to form a data set, the resolution of the original cable image is 1920*1080, the network input is 1024*512, and the data set is divided into a training set, a verification set and a test set according to a ratio of 8:1:1.
[0011] LoadBanlancingLoss=α*N*(w imp *L imp +w load *L load )
[0012] wherein alpha is a global scaling coefficient, generally in a range of 0.01-0.1; N is the total number of routing experts; w imp , w load is a weight parameter, generally 1; L imp is an importance loss, which is the sum of the gating weights of each expert; and L load is a load loss, which is the sum of the load probabilities of each expert.
[0013] The application further provides an automatic cable segmentation device based on the mixed expert model.
[0014] The model management module is based on a PP-LiteSeg coding architecture, and a mixed expert model MoE is constructed, wherein the mixed expert model MoE is integrated into an encoder and a decoder of the PP-LiteSeg coding architecture: in the PP-LiteSeg coding architecture block, a mixed expert model MoE is deployed to replace a convolution layer at a dividing point of a pooling layer / upsampling layer, the mixed expert model MoE includes a shared expert and a plurality of routing experts, the shared expert is used as a general feature extractor for all input samples, and basic features are captured, basic processing is performed on various input samples, the routing experts are specialized and divided, each routing expert focuses on specific feature processing or sub-task processing, a TOP-1 gating strategy is adopted, and a gating network is used to activate one most relevant expert according to an input sample, for extracting or processing features, compared with an ordinary network, the mixed expert model MoE reduces the calculation amount by 60% on the basis of maintaining the feature extraction capability, and realizes an efficient calculation mode of "sparse activation";
[0015] The acquisition module acquires the flat cable image, and the training module trains the mixed expert model MoE,
[0016] The segmentation module extracts multi-scale feature maps from the flat cable image by using the mixed expert model MoE of the encoder in the PP-LiteSeg coding architecture, and then fuses and restores the resolution of the feature maps of each scale by using the mixed expert model MoE of the decoder in the PP-LiteSeg coding architecture, and outputs the final segmentation map of the flat cable.
[0017] Further, the acquisition module of the device acquires the flat cable image, which includes: acquiring 4000 flat cable images to form a data set, the resolution of the original flat cable image is 1920*1080, the network input is 1024*512, and the data set is divided into a training set, a verification set and a test set according to a ratio of 8:1:1.
[0018] Further, for the mixed expert model MoE, the training module adopts a routing noise and load balancing loss function strategy, wherein the routing noise strategy introduces controllable random noise to the output of the gating network, breaks the solidification of the routing decision, considers the experts that may be ignored originally, and increases the opportunity of selecting the cold experts, and the load balancing loss function strategy is a regularization method, which ensures that all experts can be used relatively evenly.
[0019] Further, the load balancing loss function used by the training module is as follows:
[0020] LoadBanlancingLoss=α*N*(w imp *L imp +w load *L load )
[0021] wherein a is a global scaling factor, usually in the range of 0.01-0.1; N is the total number of routing experts; w imp , w load is a weight parameter, usually 1; L imp is importance loss, the sum of gating weights of each expert; L load is load loss, the sum of load probabilities of each expert.
[0022] The present application has the advantages of:
[0023] 1. The present application discloses an automatic wire cable segmentation method based on a mixed expert model, which solves the problem of insufficient cable segmentation precision under the conditions of complex background environment, variable lighting conditions, and significant specification differences.
[0024] 2. The present application uses a pooling layer / upsampling layer as a demarcation point, and innovatively divides the network into functional blocks, each of which can be replaced by MoE.
[0025] 3. The MoE module used in the present application includes shared experts and multiple routing experts. Under the condition of ensuring stable extraction of general features, the routing experts enable the model to capture more rich feature representations through specialized division of labor, enhancing the model's adaptability to complex tasks.
[0026] 4. The present application uses a gating network to dynamically select the most relevant expert activation according to the input features, reducing the computational load by 60% compared to dense connection layers.
[0027] 5. The present application uses a routing plus noise, load balancing loss function combination strategy to ensure that all experts are used relatively evenly, solving the problem of unbalanced expert utilization. BRIEF DESCRIPTION OF DRAWINGS
[0028] Figure 1 is a flowchart of the method of the present application.
[0029] Figure 2 is a schematic diagram of the overall architecture of the mixed expert model. The yellow box is the MoE block used in the present application, which replaces the blocks in the PP-LiteSeg encoder and decoder. DETAILED DESCRIPTION
[0030] Mixture of Experts (MoE) has shown strong technical scalability in the field of artificial intelligence. Its modular architecture provides an innovative paradigm for complex task processing. DeepSeek and other cutting-edge practices show that this model, through a dynamic routing mechanism and a network of experts, achieves a breakthrough in both computational efficiency and multi-scenario adaptability. Its core value lies in decoupling high-dimensional complex tasks into specialized sub-problems, which are handled by experts in specific fields, while the intelligent routing of input features is achieved through a gating network.
[0031] The application will be further described below in conjunction with the drawings and specific embodiments, so that those skilled in the art can better understand the application and implement it. However, the embodiments are not limiting the application.
[0032] Embodiment 1
[0033] The application provides an automatic wire cable segmentation method based on a mixture of experts model. Based on the PP-LiteSeg coding architecture, a mixture of experts model MoE is constructed. The mixture of experts model MoE is integrated into the encoder and decoder of the PP-LiteSeg coding architecture: in the 6 functional blocks of the PP-LiteSeg coding architecture, the pooling layer / upsampling layer is used as the demarcation point, the mixture of experts model MoE is deployed to replace the convolution layer, the mixture of experts model MoE includes 1 shared expert and 4 routing experts, the shared expert is used as a general feature extractor for all input samples to capture basic features and perform basic processing on various input samples, and the routing experts are specialized to focus on specific feature processing or sub-task processing. TOP-1 gating strategy is adopted, and a gating network is used to activate an expert with the most relevance according to the input sample, which is used for feature extraction or processing. Compared with ordinary networks, the calculation amount is reduced by 60% on the basis of maintaining the feature extraction capability, and an efficient calculation mode of "sparse activation" is realized.
[0034] Wire cable images are collected for training the mixture of experts model MoE. When collecting the wire cable images, 4000 wire cable images can be collected to form a data set, the resolution of the original wire cable images is 1920x1080, the network input is 1024x512, and the data set is divided into a training set, a validation set and a test set according to a ratio of 8:1:1.
[0035] For the mixture of experts model MoE, a routing noise and load balancing loss function strategy is adopted. The routing noise strategy introduces controllable random noise to the output of the gating network to break the solidification of the routing decision, which is used to consider the experts that may have been ignored and increase the opportunity for the selection of unpopular experts. The load balancing loss function strategy is a regularization method to ensure that all experts can be used relatively evenly.
[0036] wherein the load balancing loss function is formulaed as:
[0037] LoadBanlancingLoss=α*N*(w imp *L imp +w load *L load )
[0038] wherein alpha is a global scaling factor, usually in the range of 0.01-0.1; N is the total number of routing experts; w imp , w load is a weight parameter, usually 1; L imp is the importance loss, which is the sum of the gating weights of each expert; L load is the load loss, which is the sum of the load probabilities of each expert.
[0039] The mixed expert model MoE in the PP-LiteSeg encoding-decoding architecture is used to extract multi-scale feature maps of the cable image, and the mixed expert model MoE in the decoder of the PP-LiteSeg encoding-decoding architecture is used to fuse the feature maps of each scale and restore the resolution, and output the final segmentation map of the cable.
[0040] wherein the loss OhemCrossEntropy Loss between the network overall output and the true value GT is calculated, and is combined with LoadBanlancingLoss, and in the process of back propagation, the model weight and bias are constantly updated, so that the network output approximates to GT as much as possible. The formula of OhemCrossEntropy Loss is:
[0041]
[0042] N represents the total number of samples; i represents the i-th sample; yi represents the true label of the i-th sample; p(xi) represents the probability that the model predicts the i-th sample as positive, i.e. the probability when y=1, which is in the range of 【0,1】; log(p(xi)): when yi=1, the logarithm of the predicted probability is calculated;
[0043] log(1-p(xi)): when yi=0, the logarithm of the complement of the predicted probability is calculated; when yi is neither 1 nor 0, the loss is 0.
[0044] Embodiment 2
[0045] The application also provides an automatic cable segmentation device based on a mixed expert model, comprising a model management module, an acquisition module, a training module and a segmentation module,
[0046] The model management module is based on a PP-LiteSeg coding architecture, and a mixed expert model MoE is constructed, wherein the mixed expert model MoE is integrated into an encoder and a decoder of the PP-LiteSeg coding architecture: in the PP-LiteSeg coding architecture block, a mixed expert model MoE is deployed to replace a convolution layer at a pooling layer / upsampling layer as a demarcation point, the mixed expert model MoE includes a shared expert and a plurality of routing experts, the shared expert is used as a general feature extractor for all input samples, basic features are captured, basic processing is performed on various types of input samples, the routing experts are specialized and divided, each routing expert focuses on specific feature processing or subtask processing, a TOP-1 gating strategy is adopted, and a gating network is used to activate one most relevant expert according to the input sample, for extracting or processing features, compared with an ordinary network, the mixed expert model MoE reduces the calculation amount by 60% on the basis of maintaining the feature extraction capability, and an efficient calculation mode of "sparse activation" is realized.
[0047] The acquisition module acquires the flat cable image, and the training module trains the mixed expert model MoE,
[0048] The segmentation module extracts multi-scale feature maps from the flat cable image by using the mixed expert model MoE of the encoder of the PP-LiteSeg coding architecture, and then fuses and restores the resolution of the feature maps of each scale by using the mixed expert model MoE of the decoder of the PP-LiteSeg coding architecture, and finally outputs the segmentation map of the flat cable.
[0049] The information interaction and execution process between the modules in the device are based on the same concept as the method embodiments of the application, and the specific content can be referred to the description in the method embodiments of the application, which will not be described here.
[0050] Similarly, the device has the advantages that:
[0051] 1. The application discloses an automatic flat cable segmentation device based on a mixed expert model, which solves the problem of insufficient cable segmentation precision of traditional segmentation algorithms under conditions of complex background environment, variable illumination conditions and significant specification differences.
[0052] 2. The application divides the network into functional blocks by taking the pooling layer / upsampling layer as a demarcation point, and each block can be replaced by MoE;
[0053] 3. The MoE module adopted by the application includes a shared expert and a plurality of routing experts, under the condition of ensuring stable extraction of general features, the routing experts are specialized and divided, so that the model can capture more rich feature representations and enhance the adaptability of the model to complex tasks;
[0054] 4. The application adopts a gating network to dynamically select the most relevant 1 expert activation according to the input features, which reduces 60% of the computation compared to dense connection layers.
[0055] 5. The application adopts a routing plus noise, load balancing loss function combination strategy to ensure that all experts can be relatively balanced, solving the problem of expert utilization imbalance.
[0056] It should be noted that not all steps and modules in the above processes and device structures are necessary, and some steps or modules can be ignored according to actual needs. The execution order of each step is not fixed and can be adjusted as needed. The system structure described in the above embodiments can be a physical structure or a logical structure, that is, some modules can be implemented by the same physical entity, or some modules can be implemented by multiple physical entities, or can be implemented by some components in multiple independent devices.
[0057] The above-described embodiments are only preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Any equivalent replacement or transformation made by those skilled in the art based on the present application is within the protection scope of the present application. The protection scope of the present application is subject to the claims.
Claims
1. An automatic wire sorting cable segmentation method based on a hybrid expert model, characterized by Based on the PP-LiteSeg coding and decoding architecture, a hybrid expert model MoE is constructed, wherein the hybrid expert model MoE is integrated into the encoder and the decoder of the PP-LiteSeg coding and decoding architecture: in the PP-LiteSeg coding and decoding architecture block, the pooling layer / upsampling layer is taken as a demarcation point, a hybrid expert model MoE is deployed to replace a convolutional layer, the hybrid expert model MoE includes a shared expert and a plurality of routing experts, the shared expert is used as a general feature extractor for all input samples, basic features are captured, basic processing is performed on various input samples, the routing experts are specialized and divided, each routing expert focuses on specific feature processing or subtask processing, a TOP-1 gating strategy is adopted, and a gating network is used to activate one most relevant expert according to an input sample, for extracting or processing features; The hybrid expert model MoE is deployed in the decoder to fuse and restore the resolution of the feature map, The hybrid expert model MoE is trained by collecting the cable image, The hybrid expert model MoE in the encoder of the PP-LiteSeg coding and decoding architecture is used to extract multi-scale feature maps of the cable image, and the hybrid expert model MoE in the decoder of the PP-LiteSeg coding and decoding architecture is used to fuse and restore the resolution of the feature maps, and finally output the segmentation map of the cable.
2. The method of claim 1, wherein The cable image is collected, including: 4000 cable images are collected to form a data set, the resolution of the original cable image is 1920*1080, the network input is 1024*512, and the data set is divided into a training set, a validation set and a test set according to a ratio of 8:1:
1.
3. The method of claim 1, wherein For the hybrid expert model MoE, a routing noise and load balancing loss function strategy is adopted, wherein the routing noise strategy introduces controllable random noise to the output of the gating network, breaks the solidification of the routing decision, considers the originally ignored experts, and increases the opportunity of selecting unpopular experts, and the load balancing loss function strategy is a regularization method, which ensures that all experts can be used relatively evenly.
4. The method of claim 3, wherein The load balancing loss function is as follows: LoadBanlancingLoss = a * N * (w imp *L imp +w load *L load ) where a is a global scaling factor, usually in the range of 0.01-0.1; N is the total number of routing experts; w imp , w load is a weight parameter, usually 1; L imp is the importance loss, which is the sum of the gating weights of each expert; L load is the load loss, which is the sum of the load probabilities of each expert.
5. An automatic wire sorting cable separating apparatus based on a hybrid expert model, characterized by The model management module, the acquisition module, the training module and the segmentation module, The model management module is based on the PP-LiteSeg coding and decoding architecture, and a hybrid expert model MoE is constructed, wherein the hybrid expert model MoE is integrated into the encoder and the decoder of the PP-LiteSeg coding and decoding architecture: in the PP-LiteSeg coding and decoding architecture block, the pooling layer / upsampling layer is taken as a demarcation point, a hybrid expert model MoE is deployed to replace a convolutional layer, the hybrid expert model MoE includes a shared expert and a plurality of routing experts, the shared expert is used as a general feature extractor for all input samples, basic features are captured, basic processing is performed on various input samples, the routing experts are specialized and divided, each routing expert focuses on specific feature processing or subtask processing, a TOP-1 gating strategy is adopted, and a gating network is used to activate one most relevant expert according to an input sample, for extracting or processing features; The collection module collects the flat cable image, and the training module trains the mixed expert model MoE, The segmentation module extracts multi-scale feature maps from the flat cable image by using the mixed expert model MoE of the encoder in the PP-LiteSeg coding and decoding architecture, and then fuses and restores the resolution of each scale feature map by using the mixed expert model MoE of the decoder in the PP-LiteSeg coding and decoding architecture, and finally outputs the segmentation map of the flat cable.
6. The apparatus of claim 5 wherein The collection module collects the flat cable image, including: collecting 4000 flat cable images to form a data set, the resolution of the original flat cable image is 1920x1080, the network input is 1024x512, and the data set is divided into a training set, a verification set and a test set according to a ratio of 8:1:
1.
7. The apparatus of claim 5 wherein For the mixed expert model MoE, the training module adopts a routing plus noise and load balancing loss function strategy, wherein the routing plus noise strategy introduces controllable random noise to the output of the gating network, breaks the solidification of the routing decision, considers the experts that may be originally ignored, and increases the opportunity of the cold experts to be selected, and the load balancing loss function strategy is a regularization method, which ensures that all experts can be relatively balanced.
8. The apparatus of claim 7 wherein The load balancing loss function used by the training module is as follows: LoadBanlancingLoss = a * N * (w imp *L imp +w load *L load ) where a is a global scaling factor, usually in the range of 0.01-0.1; N is the total number of routing experts; w imp , w load is a weight parameter, usually 1; L imp is the importance loss, which is the sum of the gating weights of each expert; L load is the load loss, which is the sum of the load probabilities of each expert.
Citation Information
Patent Citations
Image segmentation paraphrasing method based on multi-expert mixing, electronic equipment and storage medium
CN115690129A
Outdoor complex environment local path planning method based on inverse reinforcement learning
CN117369458A
Hybrid expert model reasoning method
CN118863055A
Edge auxiliary feature calibration method for real-time semantic segmentation
CN119180959A
Automatic medical image segmentation method and device based on variational hybrid expert model
CN120047459A
Cited By
Coal mine image segmentation model and method based on VMama and multi-expert hybrid network and construction method thereof
CN121639706A