Image segmentation model processing method and processing device
By adjusting the layer width and knowledge distillation of the feature extraction sub-model of the image segmentation model, the problem of low image processing accuracy on edge devices is solved, efficient image segmentation on edge devices is achieved, and the applicability of the model is improved.
Patent Information
- Application Number
- CN201910845625.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-02
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2039-09-02
AI Technical Summary
Using neural networks for image processing on edge devices has problems with limited computing performance and cache, resulting in a decrease in segmentation accuracy of image segmentation models.
By adjusting the layer width and knowledge distillation of the feature extraction sub-model in the image segmentation model, the accuracy of the feature extraction sub-model is improved, the accuracy loss caused by the binary neural network model is reduced, and the segmentation accuracy of the image segmentation model is enhanced, making it Suitable for edge devices.
It improves the segmentation accuracy of the image segmentation model, reduces the amount of parameters and calculations, makes it easier to apply on edge devices, and enhances the applicability of the image segmentation model.
Smart Images

Figure CN112446888B
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing, and more specifically, to a processing method and a processing device for an image segmentation model. Background Art
[0002] Image segmentation also has application requirements on edge devices, such as vehicles or mobile phones. However, due to the limited computing performance and cache of edge devices, it is difficult to use neural networks to process images on these edge devices.
[0003] Therefore, how to obtain an image segmentation model that can be suitable for edge devices is a technical problem that needs to be solved urgently. Summary of the invention
[0004] The present application provides a processing method and a processing device for an image segmentation model, which helps to improve the segmentation accuracy of the image segmentation model so that image segmentation can be implemented on an edge device.
[0005] In a first aspect, a method for processing an image segmentation model is provided, wherein the image segmentation model includes a feature extraction sub-model and an image segmentation sub-model, wherein the feature extraction sub-model is used to extract features of an image, and the image segmentation sub-model is used to segment the image according to the extracted features, the method comprising: adjusting the layer width of the feature extraction sub-model to obtain a first feature extraction sub-model; and obtaining a target image segmentation model according to the first feature extraction sub-model and the image segmentation sub-model.
[0006] The image segmentation model may be trained or untrained.
[0007] In this method, adjusting the layer width of the feature extraction sub-model helps to improve the accuracy of the feature extraction sub-model, thereby improving the segmentation accuracy of the target image segmentation model, and making the image segmentation model easier to apply on edge devices.
[0008] Especially in the scenario where the feature extraction sub-model is a binary neural network model, the accuracy loss caused by the feature extraction sub-model being a binary neural network model can be reduced, thereby improving the segmentation accuracy of the image segmentation model.
[0009] In some possible implementations of the first aspect, the layer width adjustment of the feature extraction submodel includes: increasing the number of channels of the feature extraction submodel to obtain a second feature extraction submodel; generating K different first binary codes for the second feature extraction submodel, the first binary code including multiple binary values, the multiple binary values corresponding one-to-one to multiple channels of the second feature extraction submodel, each of the multiple binary values being used to indicate whether the channel corresponding to each binary value is retained or removed, and K is an integer greater than 1; retaining or removing the channel of the second feature extraction submodel according to the K different first binary codes, to obtain K third feature extraction submodels; and removing the channel of the second feature extraction submodel according to each of the K third feature extraction submodels. The intersection-and-union ratio and the amount of calculation when the feature extraction submodel extracts features from the image are selected, M third feature extraction submodels are selected from the K third feature extraction submodels, M is an integer greater than 1; the M first binary codes corresponding to the M third feature extraction submodels are crossover and / or mutation processed to obtain S second binary codes, S is an integer greater than 1; according to each second binary code in the S second binary codes, the channel of the second feature extraction submodel is retained or removed to obtain S fourth feature extraction submodels; the fourth feature extraction submodel is used as the third feature extraction submodel, K=S is taken, and the above fourth to sixth operations are repeatedly performed T times; one of the S fourth feature extraction submodels obtained in the last time is used as the first feature extraction submodel.
[0010] Optionally, the probability of the jth third feature extraction sub-model among the M third feature extraction sub-models being selected satisfies the following formula:
[0011]
[0012] Among them, Pr(b j ) represents the probability that the jth third feature extraction sub-model is selected, f(b j ) satisfies the following formula:
[0013] f(b j )=mIoU(j)+α / N(j)
[0014] Among them, mIoU(j) represents the intersection-over-union ratio when the j-th third feature extraction sub-model performs feature extraction on the image, N(j) represents the amount of calculation when the j-th third feature extraction sub-model performs feature extraction on the image, and α is a preset parameter.
[0015] In some possible implementations of the first aspect, obtaining the target image segmentation model based on the first feature extraction sub-model and the image segmentation sub-model includes: using a teacher feature extraction model to perform knowledge distillation on the first feature extraction model to obtain a fifth feature extraction sub-model; and obtaining the target image segmentation model based on the fifth feature extraction sub-model and the image segmentation sub-model.
[0016] Among them, the teacher model may include a feature extraction model trained using conventional methods.
[0017] In this implementation, knowledge distillation is performed on the feature extraction sub-model in the image segmentation model through the trained teacher model, which can reduce the accuracy loss caused by binarization, thereby reducing the accuracy loss of image segmentation.
[0018] Optionally, the loss function of the fifth feature extraction sub-model satisfies the following relationship:
[0019]
[0020] Among them, G ti represents the i-th scale feature among the T scale features output by the teacher feature extraction model, G si It represents the i-th scale feature among T scale features output by the fifth feature extraction submodel, where T is a positive integer, the i-th scale feature output by the teacher feature extraction model has the same scale as the i-th scale feature output by the fifth feature extraction submodel, and “|| ||” represents the matrix norm.
[0021] In some possible implementations of the first aspect, obtaining the target image segmentation model based on the fifth feature extraction sub-model and the image segmentation sub-model includes: performing knowledge distillation on the image segmentation sub-model according to the teacher image segmentation model to obtain the target image segmentation sub-model, wherein the target image segmentation model includes the fifth feature extraction sub-model and the target image segmentation sub-model.
[0022] The teacher model may include an image segmentation model trained using conventional methods.
[0023] In this implementation, the accuracy of the image segmentation model can be improved by performing knowledge distillation on the image segmentation sub-model through the trained teacher model.
[0024] Especially in the scenario where the feature extraction sub-model is a binary neural network model, the accuracy loss caused by the feature extraction sub-model being a binary neural network model can be reduced, thereby improving the accuracy of the image segmentation model.
[0025] Optionally, the loss function of the target image segmentation sub-model satisfies the following relationship:
[0026] τ(P T )=soft max(a T / τ), τ(P S )=soft max(a S / τ), L τ =H(y,P S )+λ*H(τ(P T ),τ(P S ))
[0027] Among them, P T represents the segmentation result of the teacher image segmentation model, P S represents the segmentation result of the target image segmentation sub-model, H represents the cross entropy loss function, y is used to indicate whether the segmentation result of the target image segmentation sub-model is correct, λ is a preset weight coefficient, and softmax represents the flexible maximum function.
[0028] Optionally, the feature extraction sub-model can be a binarized neural network model, which can reduce the number of parameters and the amount of computation of the image segmentation model, thereby facilitating the application of the image segmentation model on edge devices.
[0029] In a second aspect, a processing device for an image segmentation model is provided, wherein the image segmentation model includes a feature extraction sub-model and an image segmentation sub-model, wherein the feature extraction sub-model is used to extract features of an image, and the image segmentation sub-model is used to segment the image according to the extracted features, and the processing device includes: a layer width adjustment module and a knowledge distillation module.
[0030] The layer width adjustment module is used to adjust the layer width of the feature extraction sub-model in the image segmentation model to obtain a first feature extraction sub-model; the knowledge distillation module is used to obtain a target image segmentation model based on the first feature extraction sub-model and the image segmentation sub-model.
[0031] The device adjusts the layer width of the feature extraction sub-model, which helps to improve the accuracy of the feature extraction sub-model, thereby improving the segmentation accuracy of the image segmentation model, and further helps to apply the image segmentation model on edge devices.
[0032] Especially in the scenario where the feature extraction sub-model is a binary neural network model, the accuracy loss caused by the feature extraction sub-model being a binary neural network model can be reduced, thereby improving the segmentation accuracy of the image segmentation model.
[0033] In some possible implementations of the second aspect, the layer width adjustment module is specifically used to: increase the number of channels of the feature extraction submodel to obtain a second feature extraction submodel; generate K different first binary codes for the second feature extraction submodel, the first binary code includes multiple binary values, the multiple binary values correspond one-to-one to multiple channels of the second feature extraction submodel, each of the multiple binary values is used to indicate whether the channel corresponding to each binary value is retained or removed, and K is an integer greater than 1; retain or remove the channel of the second feature extraction submodel according to the K different first binary codes, to obtain K third feature extraction submodels; and remove the channel of the second feature extraction submodel according to each of the K third feature extraction submodels. The intersection-and-union ratio and the amount of calculation when the sub-model extracts features from the image are selected, M third feature extraction sub-models are selected from the K third feature extraction sub-models, M is an integer greater than 1; the M first binary codes corresponding to the M third feature extraction sub-models are crossover and / or mutation processed to obtain S second binary codes, S is an integer greater than 1; according to each second binary code in the S second binary codes, the channel of the second feature extraction sub-model is retained or removed to obtain S fourth feature extraction sub-models; the fourth feature extraction sub-model is used as the third feature extraction sub-model, K=S is taken, and the above fourth to sixth operations are repeated T times; one of the S fourth feature extraction sub-models obtained in the last time is used as the first feature extraction sub-model.
[0034] Optionally, the probability of the jth third feature extraction sub-model among the M third feature extraction sub-models being selected satisfies the following formula:
[0035]
[0036] Among them, Pr(b j ) represents the probability that the jth third feature extraction sub-model is selected, f(b j ) satisfies the following formula:
[0037] f(b j )=mIoU(j)+α / N(j)
[0038] Among them, mIoU(j) represents the intersection-over-union ratio when the j-th third feature extraction sub-model performs feature extraction on the image, N(j) represents the amount of calculation when the j-th third feature extraction sub-model performs feature extraction on the image, and α is a preset parameter.
[0039] In some possible implementations of the second aspect, the knowledge distillation module is specifically used to: use a teacher feature extraction model to perform knowledge distillation on the first feature extraction model to obtain a fifth feature extraction sub-model; and obtain the target image segmentation model based on the fifth feature extraction sub-model and the image segmentation sub-model.
[0040] Among them, the teacher model may include a feature extraction model trained using conventional methods.
[0041] In this implementation, the accuracy of image segmentation can be improved by performing knowledge distillation on the feature extraction sub-model in the image segmentation model through the trained teacher model.
[0042] Especially in the scenario where the feature extraction sub-model is a binary neural network model, the accuracy loss caused by the feature extraction sub-model being a binary neural network model can be reduced, thereby improving the accuracy of the image segmentation model.
[0043] Optionally, the loss function of the fifth feature extraction sub-model satisfies the following relationship:
[0044]
[0045] Among them, G ti represents the i-th scale feature among the T scale features output by the teacher feature extraction model, G si It represents the i-th scale feature among T scale features output by the fifth feature extraction submodel, where T is a positive integer, the i-th scale feature output by the teacher feature extraction model has the same scale as the i-th scale feature output by the fifth feature extraction submodel, and “|| ||” represents the matrix norm.
[0046] In some possible implementations of the second aspect, the knowledge distillation module is specifically used to: perform knowledge distillation on the image segmentation sub-model according to the teacher image segmentation model to obtain a target image segmentation sub-model, wherein the target image segmentation model includes the fifth feature extraction sub-model and the target image segmentation sub-model.
[0047] The teacher model may include an image segmentation model trained using conventional methods.
[0048] In this implementation, knowledge distillation is performed on the image segmentation sub-model through the trained teacher model, which can reduce the accuracy loss caused by binarization, thereby reducing the accuracy loss of image segmentation.
[0049] Optionally, the loss function of the target image segmentation sub-model satisfies the following relationship:
[0050] τ(P T )=soft max(aT / τ), τ(P S )=soft max(a S / τ), L τ =H(y,P S )+λ*H(τ(P T ),τ(P S ))
[0051] Among them, P T represents the segmentation result of the teacher image segmentation model, P S represents the segmentation result of the target image segmentation sub-model, H represents the cross entropy loss function, y is used to indicate whether the segmentation result of the target image segmentation sub-model is correct, λ is a preset weight coefficient, and softmax represents the flexible maximum function.
[0052] Optionally, the feature extraction sub-model can be a binarized neural network model, which can reduce the number of parameters and the amount of computation of the image segmentation model, thereby facilitating the application of the image segmentation model on edge devices.
[0053] In a third aspect, a processing device for an image segmentation model is provided, the device comprising: a memory for storing programs; a processor for executing the programs stored in the memory, and when the program stored in the memory is executed, the processor is used to execute the method in any one of the implementation modes of the above-mentioned first aspect.
[0054] The processor in the third aspect can be a central processing unit (CPU) or a combination of a CPU and a neural network processor, where the neural network processor can include a graphics processing unit (GPU), a neural network processing unit (NPU) and a tensor processing unit (TPU), etc. Among them, it is a dedicated integrated circuit for artificial intelligence accelerator fully customized by Google for machine learning.
[0055] According to a fourth aspect, a computer-readable medium is provided, wherein the computer-readable medium stores a program code for execution by a device, wherein the program code includes a method for executing any one of the implementations of the first aspect.
[0056] According to a fifth aspect, a computer program product comprising instructions is provided. When the computer program product is run on a computer, the computer is enabled to execute a method in any one of the implementations of the first aspect.
[0057] In a sixth aspect, a chip is provided, comprising a processor and a data interface, wherein the processor reads instructions stored in a memory through the data interface and executes a method in any one of the implementation modes in the first aspect.
[0058] Optionally, as an implementation method, the chip may also include a memory, in which instructions are stored, and the processor is used to execute the instructions stored in the memory. When the instructions are executed, the processor is used to execute the method in any one of the implementation methods in the first aspect.
[0059] The chip may specifically be a field-programmable gate array (FPGA) or an application-specific integrated circuit (ASIC).
[0060] In a seventh aspect, an electronic device is provided, which includes the processing device in the second aspect, or the electronic device includes the processing device in the third aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 It is a deployment diagram of the processing device of the present application;
[0062] Figure 2 is a schematic structural diagram of a computing device of the present application;
[0063] Figure 3 is a schematic structural diagram of a processing device according to an embodiment of the present application;
[0064] Figure 4 is a schematic flow chart of a processing method according to an embodiment of the present application;
[0065] Figure 5 It is a schematic structural diagram of a chip according to an embodiment of the present application. DETAILED DESCRIPTION
[0066] The embodiments of the present application involve a large number of neural network-related applications. In order to better understand the solutions of the embodiments of the present application, the relevant terms and other related concepts of the neural network that may be involved in the embodiments of the present application are first introduced below.
[0067] (1) Neural Network
[0068] A neural network can be composed of neural units. A neural unit can be a s The output of the operation unit with the intercept 1 as input can be shown as formula (1-1):
[0069]
[0070] Where, s = 1, 2, ... n, n is a natural number greater than 1, W s For x s , b is the bias of the neural unit. f is the activation function of the neural unit, which is used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into the output signal. The output signal of the activation function can be used as the input of the next convolutional layer, and the activation function can be a sigmoid function. A neural network is a network formed by connecting multiple single neural units mentioned above, that is, the output of one neural unit can be the input of another neural unit. The input of each neural unit can be connected to the local receptive field of the previous layer to extract the features of the local receptive field. The local receptive field can be an area composed of several neural units.
[0071] (2) Deep Neural Networks
[0072] A deep neural network (DNN), also known as a multi-layer neural network, can be understood as a neural network with multiple hidden layers. According to the position of different layers, the neural network inside the DNN can be divided into three categories: input layer, hidden layer, and output layer. Generally speaking, the first layer is the input layer, the last layer is the output layer, and the layers in between are all hidden layers. The layers are fully connected, that is, any neuron in the i-th layer must be connected to any neuron in the i+1-th layer.
[0073] Although DNN looks complicated, the work of each layer is not complicated. In simple terms, it can be expressed as the following linear relationship: in, is the input vector, is the output vector, is the offset vector, W is the weight matrix (also called coefficient), and α() is the activation function. Each layer is just an input vector After such a simple operation, the output vector Since DNN has many layers, the coefficient W and the offset vector The number of these parameters is also relatively large. The definitions of these parameters in DNN are as follows: Take the coefficient W as an example: Assume that in a three-layer DNN, the linear coefficient from the 4th neuron in the second layer to the 2nd neuron in the third layer is defined as The superscript 3 represents the layer number of the coefficient W, while the subscripts correspond to the third layer index 2 of the output and the second layer index 4 of the input.
[0074] In summary, the coefficients from the kth neuron in the L-1th layer to the jth neuron in the Lth layer are defined as
[0075] It should be noted that the input layer does not have a W parameter. In a deep neural network, more hidden layers allow the network to better describe complex situations in the real world. Theoretically, the more parameters a model has, the higher its complexity and the greater its "capacity", which means it can complete more complex learning tasks. Training a deep neural network is the process of learning the weight matrix, and its ultimate goal is to obtain the weight matrix of all layers of the trained deep neural network (the weight matrix formed by many layers of vector W).
[0076] (3) Convolutional Neural Network
[0077] Convolutional neural network (CNN) is a deep neural network with a convolutional structure. Convolutional neural network contains a feature extractor consisting of a convolution layer and a subsampling layer, which can be regarded as a filter. Convolutional layer refers to the neuron layer in the convolutional neural network that performs convolution processing on the input signal. In the convolutional layer of the convolutional neural network, a neuron can only be connected to some neurons in the adjacent layers. A convolutional layer usually contains several feature planes, each of which can be composed of some rectangularly arranged neural units. The neural units in the same feature plane share weights, and the shared weights here are convolution kernels. Shared weights can be understood as the way to extract image information is independent of position. The convolution kernel can be initialized in the form of a matrix of random size, and the convolution kernel can obtain reasonable weights through learning during the training process of the convolutional neural network. In addition, the direct benefit of shared weights is to reduce the connection between the layers of the convolutional neural network, while reducing the risk of overfitting.
[0078] (4) Loss Function
[0079] In the process of training a deep neural network, because we hope that the output of the deep neural network is as close as possible to the value we really want to predict, we can compare the predicted value of the current network with the target value we really want, and then update the weight vector of each layer of the neural network according to the difference between the two (of course, there is usually an initialization process before the first update, that is, pre-configuring parameters for each layer in the deep neural network). For example, if the predicted value of the network is high, adjust the weight vector to make it predict a lower value, and keep adjusting until the deep neural network can predict the target value we really want or a value very close to the target value we really want. Therefore, it is necessary to pre-define "how to compare the difference between the predicted value and the target value", which is the loss function or objective function, which are important equations used to measure the difference between the predicted value and the target value. Among them, taking the loss function as an example, the higher the output value (loss) of the loss function, the greater the difference, so the training of the deep neural network becomes a process of minimizing this loss as much as possible.
[0080] (5) Back propagation algorithm
[0081] Neural networks can use the error back propagation (BP) algorithm to correct the size of the parameters in the initial neural network model during the training process, so that the reconstruction error loss of the neural network model becomes smaller and smaller. Specifically, the forward transmission of the input signal to the output will generate error loss, and the parameters in the initial neural network model are updated by back propagating the error loss information, so that the error loss converges. The back propagation algorithm is a back propagation movement dominated by error loss, which aims to obtain the optimal parameters of the neural network model, such as the weight matrix.
[0082] (6) Binarized Neural Network
[0083] A binarized neural network is a neural network that binarizes the weights and activation values of some or all layers to 1 or -1. A binarized neural network usually just binarizes the weights and activation values of a floating-point neural network without changing the structure of the network.
[0084] The weights and activation values in a binary neural network can occupy a smaller storage space. In theory, the memory consumption is reduced to 1 / 32 times that of a floating-point neural network. In addition, a binary neural network uses bit operations to replace the multiplication and addition operations in a floating-point neural network, which greatly reduces the operation time. A binary neural network can also be called a binary neural network or a binary network.
[0085] (7) Knowledge Distillation
[0086] A complex neural network model is a collection of several individual neural network models, or a larger and more complex network model trained under some very strong constraints (such as a high random inactivation rate). The method of training a smaller and simpler network model (for example, a reduced model that can be configured on the application side) based on the larger and more complex network model is called knowledge distillation. Among them, the larger and more complex network model is called the teacher network, and the smaller and simpler network model is called the student network. Compared with the student network, the teacher network can provide more accurate supervision information. Compared with the teacher network, the student network has a larger computing throughput and fewer model parameters.
[0087] (8) Neural network model
[0088] A neural network model is a type of mathematical computational model that mimics the structure and function of a biological neural network (the central nervous system of an animal). A neural network model can include a variety of neural network layers with different functions, each layer including parameters and calculation formulas. Depending on the calculation formula or function, different layers in the neural network model have different names. For example, the layer that performs convolution calculations is called a convolution layer, which is often used to extract features from input signals (e.g., images).
[0089] A neural network model can also be composed of multiple existing neural network models. Neural network models with different structures can be used in different scenarios (for example, classification, recognition, or image segmentation) or provide different effects when used in the same scenario. The different structures of neural network models specifically include one or more of the following: different numbers of network layers in the neural network model, different orders of each network layer, and different weights, parameters, or calculation formulas in each network layer.
[0090] There are many different neural network models with high accuracy in the industry for application scenarios such as recognition, classification, or image segmentation. Among them, some neural network models can be trained with a specific training set to complete a task alone or in combination with other neural network models (or other functional modules) to complete a task. Some neural network models can also be directly used to complete a task alone or in combination with other neural network models (or other functional modules) to complete a task.
[0091] (9) Edge devices
[0092] Edge devices refer to any device with computing and network resources between the data source and the cloud center. For example, a mobile phone is an edge device between a person and the cloud center, and a gateway is an edge device between a smart home and the cloud center. In an ideal environment, edge devices refer to devices that analyze or process data near the data source. Since there is no data flow, network traffic and response time are reduced.
[0093] The edge device in the embodiment of the present application may be a mobile phone with computing capabilities, a tablet personal computer (TPC), a media player, a smart home, a laptop computer (LC), a personal digital assistant (PDA), a personal computer (PC), a camera, a video camera, a smart watch, a wearable device (WD) or an autonomous driving vehicle, etc. It is understandable that the embodiment of the present application does not limit the specific form of the edge device.
[0094] Image processing, such as image segmentation or image classification (recognition), also has application requirements on edge devices, such as vehicles or mobile phones. However, due to the limited computing performance and cache of edge devices, it is difficult to use neural networks to process images on these edge devices. To use neural networks to process images on edge devices, it is necessary to reduce the image processing model composed of the neural network, which will reduce the accuracy of the image processing model. Examples of image processing models in the embodiments of the present application are image segmentation models or image classification models.
[0095] In response to this problem, the present application proposes a processing method and a processing device for an image segmentation model. The processing method and the processing device improve the accuracy of the feature extraction model by adjusting the layer width of the feature extraction sub-model in the image segmentation model. Furthermore, the processing method and the processing device also improve the accuracy by performing knowledge distillation processing on the feature extraction sub-model and the image segmentation sub-model in the image segmentation model. In other words, the processing method and the processing device proposed in the present application help to improve the segmentation accuracy of the image segmentation model, thereby facilitating the application of the image segmentation model on edge devices.
[0096] Figure 1: is a deployment diagram of a processing device provided in an embodiment of the present application. The processing device can be deployed in a cloud environment. The cloud environment is an entity that uses basic resources to provide cloud services to users in a cloud computing model. The cloud environment includes a cloud data center and a cloud service platform. The cloud data center includes a large number of basic resources (including computing resources, storage resources, and network resources) owned by a cloud service provider. The computing resources included in the cloud data center can be a large number of computing devices (such as servers). The processing device can be a server in a cloud data center for adjusting an image segmentation model; the processing device can also be a virtual machine created in a cloud data center for adjusting an image processing model; the processing device can also be a software device deployed on a server or virtual machine in a cloud data center, the software device is used to adjust the image segmentation model, and the software device can be distributedly deployed on multiple servers, or distributedly deployed on multiple virtual machines, or distributedly deployed on virtual machines and servers.
[0097] like Figure 1 As shown, the processing device can be abstracted by the cloud service provider into a cloud service for adjusting the image processing model on the cloud service platform and provided to the user. After the user purchases the cloud service on the cloud service platform, the cloud environment uses the cloud service to provide the user with the cloud service for adjusting the image processing model. The user can upload the image processing model to be adjusted to the cloud environment through the application program interface (API) or through the web interface provided by the cloud service platform. The processing device receives the image processing model to be adjusted and adjusts the image processing model to be adjusted. The adjustment result is returned by the processing device to the edge device where the user is located, or the adjustment result is stored in the cloud environment, for example: presented on the web interface of the cloud service platform for the user to view.
[0098] When the processing device is a software device, the processing device may also be deployed separately on a computing device in any environment, for example, separately on an edge device or separately on a computing device in a data center. Figure 2 As shown, computing device 200 includes a bus 201 , a processor 202 , a communication interface 203 , and a memory 204 .
[0099] The processor 202, the memory 204 and the communication interface 203 communicate with each other through the bus 201. The processor 202 may be a central processing unit (CPU). The memory 204 may include a volatile memory (volatile memory), such as a random access memory (random access memory, RAM). The memory 204 may also include a non-volatile memory (2NVM), such as a read-only memory (2ROM), a flash memory, a hard disk drive (HDD) or a solid state disk (SSD). The memory 204 stores the executable code included in the detection device, and the processor 202 reads the executable code in the memory 204 to execute the method for video similarity detection. The memory 204 may also include software modules required for other running processes such as an operating system. The operating system may be LINUX. TM , UNIX TM , WINDOWS TM wait.
[0100] Figure 3 Schematic diagram of the structure of a processing device 300 of an embodiment of the present application. The processing device is used to process the image segmentation model to obtain a target image segmentation model with relatively less computational effort and less precision loss. This can make the target image segmentation model more suitable for application on edge devices.
[0101] The processing device 300 includes a layer width adjustment module 310 and a knowledge distillation module 320. The image segmentation model to be adjusted may include a feature extraction submodel and an image segmentation submodel, wherein the feature extraction submodel is used to extract features of an image, and the image segmentation submodel is used to segment the image according to the extracted features.
[0102] An example of the feature extraction sub-model is a convolutional neural network; an example of the image segmentation sub-model is a convolutional neural network.
[0103] It can be understood that the embodiment of the present application is only an exemplary division of the structure and functional modules of the processing device 300, and the present application does not impose any limitation on its specific division.
[0104] Figure 4 It is a schematic flowchart of the processing method of the image segmentation model of an embodiment of the present application. Figure 4 The method shown includes S410 and S420. Figure 3 Taking the processing device shown as an example, the processing method of the present application is introduced.
[0105] S410 , adjusting the layer width of the feature extraction sub-model in the image segmentation model to obtain a first feature extraction sub-model. This step may be performed by the layer width processing module 310 .
[0106] The layer width adjustment of the feature extraction sub-model described here can be understood as adjusting the channels of all or part of the layers of the feature extraction sub-model. For example, some channels are first added, and then some channels are removed according to a reasonable method to reduce the accuracy loss when the feature extraction sub-model extracts features, thereby improving the segmentation accuracy of the image segmentation model.
[0107] This feature extraction sub-model can extract features of images at different scales.
[0108] In some possible implementations, a genetic algorithm can be used to adjust the layer width of the feature extraction submodel.
[0109] When adjusting the layer width of the feature extraction sub-model by using a genetic algorithm, one implementation method includes the following operations.
[0110] The number of channels of the feature extraction sub-model is increased to obtain a second feature extraction sub-model.
[0111] Binarize multiple channels of the second feature extraction sub-model K times to obtain K different first binary codes, where the first binary code includes multiple binary values, and the multiple binary values correspond one-to-one to the multiple channels. Each of the multiple binary values is used to indicate whether the channel corresponding to each binary value is retained or removed, and K is an integer greater than 1.
[0112] Channels of the second feature extraction sub-model are retained or removed according to K different first binary codes to obtain K third feature extraction sub-models.
[0113] According to the intersection-and-union ratio and the amount of calculation when each third feature extraction submodel in the K third feature extraction submodels extracts features from an image (e.g., an image in a verification image set), M third feature extraction submodels are selected from the K third feature extraction submodels, where M is a positive integer. At this time, if M is 1, that is, only one third feature extraction submodel is selected, the third feature extraction submodel can be used as the first feature extraction submodel. If M is greater than 1, the following operations can be continued.
[0114] The M first binary codes corresponding to the M third feature extraction sub-models are subjected to crossover and / or mutation processing to obtain S second binary codes, where S is an integer greater than 1. The value of S may be set in advance based on experience.
[0115] According to each of the S second binarization codes, a channel of the second feature extraction sub-model is retained or removed to obtain S fourth feature extraction sub-models.
[0116] The fourth feature extraction sub-model is regarded as the third feature extraction sub-model, K=S is taken, and the fourth to sixth operations are repeatedly performed.
[0117] Among them, binarizing multiple channels of the second feature extraction submodel to obtain the first binary code can be understood as: generating a string of values, the string of values includes multiple values, each value is any one of two preset values, the number of this string of values is the same as the total number of the multiple channels of the second feature extraction submodel, and the multiple values in this string of values correspond one-to-one to the multiple channels in the second feature extraction submodel, and each value in this string of values is used to indicate whether the corresponding channel is retained or removed. This string of values is the binary code.
[0118] For example, two numerical values "0" and "1" are preset, "0" means removing the corresponding channel, and "1" means retaining the corresponding channel. When the 10 channels of the second feature extraction sub-model are binarized once, a string of codes is randomly generated, such as "1001101101". This string of codes is the first binarized code obtained by binarizing the second feature extraction sub-model once.
[0119] In some possible designs, the number of repetitions of the fourth to sixth operations may be preset. When all the repetitions are completed, if multiple fourth feature sub-models are obtained, one of them may be selected as the first feature extraction sub-model, for example, the fourth feature sub-model with the highest probability is selected as the first feature extraction sub-model.
[0120] In some other possible designs, the fourth to sixth operations are repeatedly performed until the S second binary codes are the same, and the fourth feature extraction sub-model obtained according to the second binary code is used as the first feature extraction sub-model.
[0121] When M third feature extraction submodels are selected from the K third feature extraction submodels based on the intersection-and-union ratio and the amount of calculation when each third feature extraction submodel in the K third feature extraction submodels performs feature extraction on the image, the fitness of the third feature submodel can be first calculated based on the intersection-and-union ratio and the amount of calculation when each third feature extraction submodel performs feature extraction on the image, and then the probability of the third feature extraction submodel being selected is calculated based on the fitness.
[0122] The fitness f(b j ) satisfies the following formula:
[0123] f(b j )=mIoU(j)+α / N(j)
[0124] Among them, mIoU(j) represents the intersection-over-union ratio when the j-th third feature extraction sub-model performs feature extraction on the image, N(j) represents the amount of computation when the j-th third feature extraction sub-model performs feature extraction on the image, and α is a preset parameter, also called a hyperparameter.
[0125] The probability Pr(b j ) satisfies the following formula:
[0126]
[0127] After calculating the probabilities of the K third feature extraction sub-models being selected respectively, in some possible implementations, the K third feature sub-models can be sorted in descending order according to the probability values, and then the first M third feature sub-models are selected as the fourth feature extraction sub-model, and the size of M can be preset based on experience.
[0128] Since the average intersection-over-union ratio of the adjusted feature extraction sub-model remains consistent with that before the layer width is adjusted, the accuracy loss can be reduced.
[0129] In one implementation of cross-processing the M first binary codes corresponding to the M third feature extraction sub-models, each time the cross-processing is performed, any two first binary codes are selected from the M first binary codes, and then the partial codes of the same length in the two first binary codes are exchanged to obtain two new binary codes. For example, one first binary code is 0101011100100101, and the other first binary code is 010110101010110110, and the sixth to twelfth values of the two first binary codes are exchanged to obtain 010100101010110101 and 0101111100100110, respectively.
[0130] In one implementation of performing mutation processing on S binary codes obtained by cross-processing M first binary codes, for a binary code, replace the value of any length therein with other values, thereby obtaining a different binary code. For example, for the binary code 1001001010101101010, select the fourth to eleventh bit values 10010101, and replace them with 01101010, thereby obtaining the binary code 10001101010101010. Performing mutation processing on the S binary codes can obtain S new binary codes. For the convenience of subsequent description, the binary code obtained by mutation is called the second binary code.
[0131] Optionally, the M first binary codes corresponding to the M third feature extraction sub-models can be directly cross-processed to obtain M second binary codes. In this case, M is equal to S.
[0132] Optionally, the M first binary codes corresponding to the M third feature extraction sub-models may be cross-processed to obtain S new binary codes, and no mutation processing may be performed. In this case, the S binary codes are S second binary codes.
[0133] S420, obtaining a target image segmentation model according to the first feature extraction sub-model and the image segmentation sub-model in the image segmentation model. This step may be performed by the knowledge distillation module 320.
[0134] In some possible implementations, the image segmentation model composed of the first feature extraction sub-model and the image segmentation sub-model may be used as the target image segmentation model.
[0135] In some other possible implementations, the image segmentation model can be subjected to knowledge distillation using a trained teacher image segmentation model, and the image segmentation model obtained by distillation is used as the target image segmentation model. This implementation can improve the segmentation accuracy of the target image segmentation model.
[0136] Optionally, in this implementation, the first feature extraction submodel may be subjected to knowledge distillation according to the feature extraction submodel in the teacher image segmentation model, and the image segmentation submodel in the image segmentation model to be trained may be subjected to knowledge distillation according to the image segmentation submodel in the teacher image segmentation model. The feature extraction submodel in the teacher model may be referred to as the teacher feature extraction submodel, and the image segmentation submodel in the teacher model may be referred to as the teacher image segmentation submodel.
[0137] The following uses the example of the first feature extraction sub-model being able to extract multi-scale features from an image to introduce how the teacher image segmentation model implements knowledge distillation on the image segmentation model. Knowledge distillation is also called guided training.
[0138] The feature map of the i-th scale extracted by the teacher feature extraction sub-model is denoted as The feature map of the i-th scale extracted by the first feature extraction sub-model is denoted as Among them, c ti and c si is the number of channels, h i and w i is the height and width of the feature map, Indicates c ti ×h i × i dimensional matrix, Indicates c si ×h i × i dimensional matrix, i ranges from 1 to 4.
[0139] Add the feature values of all channels of the i-th scale feature map output by the teacher feature extraction sub-model to obtain The eigenvalues of all channels of the i-th scale feature map output by the first feature extraction sub-model are added together to obtain Then the loss function of the first feature extraction sub-model at the i-th scale is
[0140]
[0141] Among them, || || can be any norm of the matrix. The value of i ranges from 1 to 4, and four loss functions of different scales are obtained.
[0142] The first feature extraction sub-model is trained according to the above four loss functions of the first feature extraction sub-model, that is, knowledge distillation is performed to obtain the fifth feature extraction sub-model.
[0143] The output of the teacher image segmentation sub-model is denoted as The output of the image segmentation sub-model is recorded as Then the loss function of the image segmentation sub-model satisfies the following formula:
[0144] τ(P T )=soft max(a T / τ), τ(P S )=soft max(a S / τ), L τ =H(y,P S )+λ*H(τ(P T ),τ(P S ))
[0145] Among them, P T represents the segmentation result of the teacher image segmentation model, P S represents the segmentation result of the image segmentation sub-model, H represents the cross entropy loss function, y is used to indicate whether the segmentation result of the image segmentation sub-model is correct, λ is the preset trade-off coefficient, and softmax represents the flexible maximum function.
[0146] The image segmentation sub-model is trained according to the loss function of the image segmentation sub-model to obtain the target image segmentation sub-model.
[0147] The fifth feature extraction sub-model and the target image segmentation sub-model constitute the target image segmentation model. The target image segmentation model obtained by knowledge distillation can greatly improve the accuracy of the output result, that is, the accuracy of the segmentation result.
[0148] In some other possible implementations, knowledge distillation may be performed only on the first feature extraction sub-model, and the image segmentation model formed by the feature extraction sub-model obtained by distillation and the image segmentation sub-model is used as the target image segmentation model. This implementation may also improve the segmentation accuracy of the target image segmentation model.
[0149] In some other possible implementations, knowledge distillation may be performed only on the image segmentation sub-model, and the image segmentation model formed by the distilled image segmentation sub-model and the first feature extraction sub-model is used as the target image segmentation model. This implementation may also improve the segmentation accuracy of the target image segmentation model.
[0150] The feature extraction submodel in the embodiment of the present application can be a binary neural network model. This can reduce the number of parameters and the amount of calculation of the feature extraction submodel, thereby reducing the number of parameters and the amount of calculation of the target image segmentation model, which is helpful for applying the image segmentation model on the edge device.
[0151] Although the binarized neural network model may reduce the accuracy of the feature extraction sub-model, the loss of accuracy can be reduced because the layer width of the feature extraction sub-model is adjusted in the embodiment of the present application. In addition, the loss of accuracy can be further reduced by performing knowledge distillation on the image segmentation model through the teacher model in the embodiment of the present application.
[0152] The present application also provides an image segmentation method, which includes: using the image segmentation model obtained by the processing method in S410 to segment the image to be processed to obtain a segmentation result.
[0153] The present application also provides an image segmentation model, which includes: an image segmentation model obtained using the processing method in S410.
[0154] The present application also provides a Figure 2 The computing device 200 shown in FIG. 1 is a processor 202 in the computing device 200 that reads the executable code stored in the memory 204 to execute the aforementioned Figure 4 The processing method described in .
[0155] The present application also provides a Figure 5 The chip 500 shown in the figure may include a processor 502, which reads the executable code stored in the memory to execute the steps performed by the layer width adjustment module 310 and the knowledge distillation module 320, thereby realizing the aforementioned Figure 4The processing method described in .
[0156] The chip 500 may further include a memory 504 for storing executable codes.
[0157] The chip 500 may further include a communication interface 503 for inputting an image segmentation model to be trained and / or outputting a target image segmentation model. Optionally, it may also be used to input a teacher model.
[0158] The present application also provides a method for processing a neural network model, which may be an image classification model, an image recognition model, a speech recognition model, etc.
[0159] Optionally, the neural network model may include a binarized neural network sub-model.
[0160] The processing method includes: adjusting the layer width of the neural network model. The method of adjusting the layer width of the neural network model can refer to S410.
[0161] Furthermore, the processing method may also include performing knowledge distillation on the neural network model according to the teacher model. The method for implementing knowledge distillation may refer to S420.
[0162] The present application also provides a computing device similar to computing device 200, in which a processor reads executable code stored in a memory to execute the aforementioned processing method of the neural network model.
[0163] The present application also provides a processing device similar to the processing device 300, which is used to execute the processing method of the aforementioned neural network model.
[0164] The present application also provides a chip similar to chip 500, which is used to execute the processing method of the aforementioned neural network model.
[0165] The descriptions of the processes corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process, please refer to the relevant descriptions of other processes.
[0166] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product for video similarity detection includes one or more computer instructions for video similarity detection. When these computer program instructions are loaded and executed on a computer, all or part of the embodiments of the present application are generated. Figure 4 The process or function described.
[0167] The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line, or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium is a readable storage medium storing computer program instructions for video similarity detection. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., an SSD).
Claims
1. A method for processing an image segmentation model, wherein the image segmentation model comprises a feature extraction sub-model and an image segmentation sub-model, wherein the feature extraction sub-model is used to extract features of an image, and the image segmentation sub-model is used to segment the image according to the extracted features, wherein: include: Adjusting the layer width of the feature extraction sub-model to obtain a first feature extraction sub-model; Performing knowledge distillation processing on the first feature extraction sub-model and the image segmentation sub-model to obtain a target image segmentation model; The step of adjusting the layer width of the feature extraction sub-model to obtain a first feature extraction sub-model includes: Operation 1: increasing the number of channels of the feature extraction sub-model to obtain a second feature extraction sub-model, and performing binarization encoding processing on the second feature extraction sub-model to obtain K third feature extraction sub-models; Operation 2: performing selection, crossover and / or mutation processing, retention or removal processing on the K third feature extraction sub-models to obtain S fourth feature extraction sub-models, and using the fourth feature extraction sub-models as the third feature extraction sub-model, taking K=S, and repeating operation 2 T times; Operation three: using one of the S fourth feature extraction sub-models obtained for the last time as the first feature extraction sub-model.
2. The processing method according to claim 1, characterized in that The step of performing binarization encoding processing on the second feature extraction sub-model to obtain K third feature extraction sub-models includes: Generate K different first binary codes for the second feature extraction submodel, the first binary code includes a plurality of binary values, the plurality of binary values correspond one-to-one to a plurality of channels of the second feature extraction submodel, each of the plurality of binary values is used to indicate whether the channel corresponding to each binary value is retained or removed, and K is an integer greater than 1; Retain or remove channels of the second feature extraction sub-model according to the K different first binary codes to obtain the K third feature extraction sub-models; The step of obtaining S fourth feature extraction sub-models after selecting, crossover and / or mutating, retaining or removing the K third feature extraction sub-models comprises: Selecting M third feature extraction sub-models from the K third feature extraction sub-models according to the intersection-and-union ratio and the amount of calculation when each third feature extraction sub-model in the K third feature extraction sub-models extracts features from the image, where M is an integer greater than 1; Performing crossover and / or mutation processing on the M first binary codes corresponding to the M third feature extraction sub-models to obtain S second binary codes, where S is an integer greater than 1; The channels of the second feature extraction sub-model are retained or removed according to each second binarization code in the S second binarization codes to obtain the S fourth feature extraction sub-models.
3. The processing method according to claim 2, characterized in that: The probability of the jth third feature extraction sub-model among the M third feature extraction sub-models being selected satisfies the following formula: in, represents the probability of the j-th third feature extraction sub-model being selected, represents the fitness of the j-th third feature extraction sub-model, represents the fitness of the kth third feature extraction sub-model, Satisfies the following formula: in, represents the intersection-over-union ratio when the j-th third feature extraction sub-model extracts features from the image, represents the amount of computation when the j-th third feature extraction sub-model extracts features from the image, is a preset parameter.
4. The processing method according to claim 3, characterized in that: The step of performing the knowledge distillation process according to the first feature extraction sub-model and the image segmentation sub-model to obtain a target image segmentation model includes: Use the teacher feature extraction model to perform knowledge distillation on the first feature extraction sub-model to obtain a fifth feature extraction sub-model; The target image segmentation model is obtained according to the fifth feature extraction sub-model and the image segmentation sub-model.
5. The processing method according to claim 4, characterized in that: The loss function of the fifth feature extraction sub-model satisfies the following relationship: in, represents the i-th scale feature among the T scale features output by the teacher feature extraction model, Indicates that the fifth feature extraction sub-model outputs the i-th scale feature among T scale features, T is a positive integer, and the i-th scale feature output by the teacher feature extraction model has the same scale as the i-th scale feature output by the fifth feature extraction sub-model, " ” represents the matrix norm.
6. The processing method according to claim 5, characterized in that: The step of performing the knowledge distillation process according to the fifth feature extraction sub-model and the image segmentation sub-model to obtain the target image segmentation model includes: The image segmentation sub-model is subjected to knowledge distillation according to the teacher image segmentation model to obtain a target image segmentation sub-model, wherein the target image segmentation model includes the fifth feature extraction sub-model and the target image segmentation sub-model.
7. The processing method according to claim 6, characterized in that: The loss function of the target image segmentation sub-model satisfies the following relationship: , , in, represents the segmentation result of the teacher image segmentation model, represents the segmentation result of the target image segmentation sub-model, is the intermediate function, represents the output of the teacher image segmentation sub-model, represents the output of the image segmentation sub-model, is the temperature coefficient, represents the loss function of the target image segmentation sub-model, represents the cross entropy loss function, y is used to indicate whether the segmentation result of the target image segmentation sub-model is correct, is the preset trade-off coefficient, and softmax represents the flexible maximum function.
8. The processing method according to any one of claims 1 to 7, characterized in that: The feature extraction sub-model is a binarized neural network model.
9. A processing device for an image segmentation model, the image segmentation model comprising a feature extraction sub-model and an image segmentation sub-model, the feature extraction sub-model is used to extract features of an image, and the image segmentation sub-model is used to segment the image according to the extracted features, characterized in that: include: A layer width adjustment module, used for adjusting the layer width of the feature extraction sub-model to obtain a first feature extraction sub-model; A knowledge distillation module, used for performing knowledge distillation processing on the first feature extraction sub-model and the image segmentation sub-model to obtain a target image segmentation model; The layer width adjustment module is specifically used for: Operation 1: increasing the number of channels of the feature extraction sub-model to obtain a second feature extraction sub-model, and performing binarization encoding processing on the second feature extraction sub-model to obtain K third feature extraction sub-models; Operation 2: performing selection, crossover and / or mutation processing, retention or removal processing on the K third feature extraction sub-models to obtain S fourth feature extraction sub-models, and using the fourth feature extraction sub-models as the third feature extraction sub-model, taking K=S, and repeating operation 2 T times; Operation three: using one of the S fourth feature extraction sub-models obtained for the last time as the first feature extraction sub-model.
10. The processing device according to claim 9, characterized in that The layer width adjustment module is specifically used for: Generate K different first binary codes for the second feature extraction submodel, the first binary code includes a plurality of binary values, the plurality of binary values correspond one-to-one to a plurality of channels of the second feature extraction submodel, each of the plurality of binary values is used to indicate whether the channel corresponding to each binary value is retained or removed, and K is an integer greater than 1; Retain or remove channels of the second feature extraction sub-model according to the K different first binary codes to obtain the K third feature extraction sub-models; Selecting M third feature extraction sub-models from the K third feature extraction sub-models according to the intersection-and-union ratio and the amount of calculation when each third feature extraction sub-model in the K third feature extraction sub-models extracts features from the image, where M is an integer greater than 1; Performing crossover and / or mutation processing on the M first binary codes corresponding to the M third feature extraction sub-models to obtain S second binary codes, where S is an integer greater than 1; The channels of the second feature extraction sub-model are retained or removed according to each second binarization code in the S second binarization codes to obtain the S fourth feature extraction sub-models.
11. The processing device according to claim 10, characterized in that The probability of the jth third feature extraction sub-model among the M third feature extraction sub-models being selected satisfies the following formula: in, represents the probability that the j-th third feature extraction sub-model is selected, represents the fitness of the j-th third feature extraction sub-model, represents the fitness of the kth third feature extraction sub-model, Satisfies the following formula: in, represents the intersection-over-union ratio when the j-th third feature extraction sub-model extracts features from the image, represents the amount of computation when the j-th third feature extraction sub-model extracts features from the image, is a preset parameter.
12. The processing device according to claim 11, characterized in that The knowledge distillation module is specifically used for: Use the teacher feature extraction model to perform knowledge distillation on the first feature extraction sub-model to obtain a fifth feature extraction sub-model; The target image segmentation model is determined according to the fifth feature extraction sub-model and the image segmentation sub-model.
13. The processing device according to claim 12, characterized in that The loss function of the fifth feature extraction sub-model satisfies the following relationship: in, represents the i-th scale feature among the T scale features output by the teacher feature extraction model, Indicates that the fifth feature extraction sub-model outputs the i-th scale feature among T scale features, T is a positive integer, and the i-th scale feature output by the teacher feature extraction model has the same scale as the i-th scale feature output by the fifth feature extraction sub-model, " ” represents the matrix norm.
14. The processing device according to claim 13, characterized in that The knowledge distillation module is specifically used for: The image segmentation sub-model is subjected to knowledge distillation according to the teacher image segmentation model to obtain a target image segmentation sub-model, wherein the target image segmentation model includes the fifth feature extraction sub-model and the target image segmentation sub-model.
15. The processing device according to claim 14, characterized in that The loss function of the target image segmentation sub-model satisfies the following relationship: , , in, represents the segmentation result of the teacher image segmentation model, represents the segmentation result of the target image segmentation sub-model, is the intermediate function, represents the output of the teacher image segmentation sub-model, represents the output of the image segmentation sub-model, is the temperature coefficient, represents the loss function of the target image segmentation sub-model, represents the cross entropy loss function, y is used to indicate whether the segmentation result of the target image segmentation sub-model is correct, is the preset trade-off coefficient, and softmax represents the flexible maximum function.
16. The processing device according to any one of claims 9 to 15, characterized in that The feature extraction sub-model is a binarized neural network model.
17. A processing device for an image segmentation model, characterized in that: The method comprises a processor and a memory, wherein the memory is used to store program instructions, and the processor is used to call the program instructions to execute the processing method according to any one of claims 1 to 8.
18. A computer-readable storage medium, characterized in that: The computer-readable medium stores instructions for implementing the processing method according to any one of claims 1 to 8.
19. A chip, characterized in that: The chip includes a processor and a data interface, and the processor reads instructions stored in a memory through the data interface to execute the processing method according to any one of claims 1 to 8.
