Image processing model generation method and device, medium and electronic equipment

By replacing the decoder in the original image processing model and generating the target image processing model, the problems of slow inference speed and high memory consumption in the prior art are solved, and faster inference and lower resource usage are achieved.

CN119516005APending Publication Date: 2025-02-25BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311030344.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-15
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The existing image processing models have problems such as slow inference speed and high memory consumption in super-segment services.

Method used

By acquiring the first decoder and the original image processing model that has been trained, replacing the original decoder in the original autoencoding module as the first decoder, and training the target autoencoding module, obtaining the second decoder that has been trained, and finally replacing the original decoder in the original image processing model with the second decoder, generating the target image processing model.

Benefits of technology

By replacing the decoder, the resource usage of the image processing model in the inference process is reduced, the inference speed is improved, and the memory consumption is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119516005A_ABST
    Figure CN119516005A_ABST
Patent Text Reader

Abstract

The invention relates to an image processing model generation method and device, a medium and electronic equipment, and the method comprises the steps: obtaining a first decoder and a trained original image processing model, the original image processing model comprises an original self-coding module and other modules except the original self-coding module, the original self-encoding module comprises an original encoder and an original decoder, and resources used when the original decoder works are higher than resources used when the first decoder works; replacing an original decoder in the original self-encoding module with the first decoder to obtain a target self-encoding module; training the target self-encoding module to obtain a trained second decoder; and replacing an original decoder in the original image processing model with the second decoder to obtain a target image processing model, thereby reducing resource use of the target image processing model in actual reasoning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of electronic information technology, and in particular, to an image processing model generation method, device, medium and electronic equipment. Background Art

[0002] With the rapid development of computers, more and more image processing models have emerged. In practical applications, the effect and efficiency of image processing models are important indicators to measure their performance. The efficiency of image processing models is affected by the hardware configuration of the terminal itself, and the effect and efficiency requirements of image processing models for different services are also different. In super-resolution services, current image processing models have problems such as slow inference speed and high memory consumption. Summary of the invention

[0003] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0004] In a first aspect, the present disclosure provides a method for generating an image processing model, comprising:

[0005] Acquire a first decoder and a trained original image processing model, wherein the original image processing model includes an original self-encoding module and other modules except the original self-encoding module, the original self-encoding module includes an original encoder and an original decoder, and the resources used by the original decoder when working are higher than the resources used by the first decoder when working;

[0006] Replacing the original decoder in the original autoencoder module with the first decoder to obtain a target autoencoder module;

[0007] Training the target autoencoder module to obtain a trained second decoder;

[0008] The original decoder in the original image processing model is replaced with the second decoder to obtain a target image processing model.

[0009] In a second aspect, the present disclosure provides an image processing model generation device, comprising:

[0010] A first acquisition module is used to acquire a first decoder and a trained original image processing model, wherein the original image processing model includes an original self-encoding module and other modules except the original self-encoding module, the original self-encoding module includes an original encoder and an original decoder, and the resources used by the original decoder when working are higher than the resources used by the first decoder when working;

[0011] A first replacement module, used for replacing an original decoder in the original autoencoder module with the first decoder to obtain a target autoencoder module;

[0012] A training module, used for training the target autoencoder module to obtain a trained second decoder;

[0013] The second replacement module is used to replace the original decoder in the original image processing model with the second decoder to obtain a target image processing model.

[0014] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which implements the steps of the method described in the first aspect when the program is executed by a processing device.

[0015] In a fourth aspect, the present disclosure provides an electronic device, including:

[0016] a storage device having a computer program stored thereon;

[0017] A processing device is used to execute the computer program in the storage device to implement the steps of the method in the first aspect.

[0018] Through the above technical solution, the original decoder in the original image processing model is replaced with the second decoder to obtain the target image processing model. Since the second decoder is obtained by training the first decoder and the resources used by the original decoder are higher than the resources used by the first decoder, in actual reasoning, the target image processing model with the second decoder uses fewer resources than the original image processing model with the original decoder and has a faster reasoning speed.

[0019] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings:

[0021] Figure 1 The figure is a flowchart of a method for generating an original image processing model according to an exemplary embodiment of the present disclosure.

[0022] Figure 2 It is a structural schematic diagram of an original image processing model according to an exemplary embodiment of the present disclosure.

[0023] Figure 3 A block diagram of a device for generating an image processing model according to an exemplary embodiment of the present disclosure is shown.

[0024] Figure 4 A schematic diagram of the structure of an electronic device is shown according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0025] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0026] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0027] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0028] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0029] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0030] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0031] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0032] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0033] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0034] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0035] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0036] Figure 1 is a flowchart of an image processing model generation method according to an exemplary embodiment of the present disclosure, the image processing model generation method can be executed by an electronic device, referring to Figure 1 , the image processing model generation method may include the following steps:

[0037] Step 101, obtain a first decoder and a trained original image processing model, wherein the original image processing model includes an original autoencoding module and other modules except the original autoencoding module, the original autoencoding module includes an original encoder and an original decoder, and the resources used by the original decoder when working are higher than the resources used by the first decoder when working.

[0038] The original image processing model may be an image processing model based on the infrastructure of the StableDiffusion model. In this case, other modules besides the original autoencoder module may include a generative model based on noise diffusion and noise removal (i.e., a diffusion module) and a conditional control module. The conditional control module is used to add conditional control in the noise removal stage, where the conditional control may be, for example, text information and image information of a low-resolution image.

[0039] In the original image processing model, the original encoder in the original self-encoding module encodes and compresses the input image into the latent space, and the diffusion module performs forward noise diffusion on the data compressed into the latent space. Forward noise diffusion is the process of adding noise; under the action of the conditional control module, the diffusion module performs reverse noise removal on the noise image obtained by performing forward noise diffusion, so that the generated target image gradually approaches the user's needs. Here, the conditional control module can represent the user's needs. In addition, the training of the original image processing model can refer to the following embodiment, and this embodiment will not be repeated here.

[0040] Step 102: Replace the original decoder in the original auto-encoding module with the first decoder to obtain a target auto-encoding module.

[0041] It can be understood that the target self-encoding module includes a first decoder and an original encoder.

[0042] Step 103: train the target autoencoder module to obtain a trained first decoder.

[0043] It can be understood that other modules except the original autoencoder module in the original image processing model are not trained, so that the resources required for training can be reduced.

[0044] In addition, the first decoder in the trained target autoencoder module is the second decoder that has completed the training. The training of the target autoencoder module can refer to the following related embodiments, which will not be described in detail in this embodiment.

[0045] Step 104, replacing the original decoder in the original image processing model with the second decoder to obtain the target image processing model.

[0046] It is worth noting that the target image processing model only improves the original decoder, and the target image processing model includes the original encoder, the trained second decoder and the other modules mentioned above.

[0047] Through the above method, the original decoder in the original image processing model is replaced with the second decoder to obtain the target image processing model. Since the second decoder is obtained by training the first decoder, and the resources used by the original decoder are higher than the resources used by the first decoder, in actual reasoning, the target image processing model with the second decoder uses fewer resources than the original image processing model with the original decoder, and the reasoning speed is also faster, which is more in line with practical applications, especially for electronic devices with requirements on computing power and power consumption.

[0048] In some embodiments, the original decoder may be improved to obtain a first decoder.

[0049] Through the above method, the original decoder is directly improved, reducing the difficulty of developing the first decoder

[0050] It is worth noting that, in other embodiments, it is not necessary to obtain the first decoder based on improving the original decoder, but a new decoder is newly developed as the first decoder.

[0051] In some embodiments, the above-mentioned step of training the target autoencoder module to obtain a second decoder that has completed the training can be implemented in the following manner: obtaining an image training set, wherein the image training set includes multiple first sample images; inputting each first sample image into the target autoencoder module to obtain a first predicted image output by the target autoencoder module; based on the difference between the first sample image and the first predicted image corresponding to the first sample image, adjusting the network parameters of the first decoder without changing the network parameters of the original encoder in the target autoencoder module until the stop adjustment condition is met to obtain a second decoder that has completed the training.

[0052] The original encoder in the target self-encoding module performs a low-dimensional representation on the first sample image, and the first decoder decodes the low-dimensional representation to output a first predicted image.

[0053] It is worth noting that when training other modules except the original autoencoder module in the original image processing model, the other modules are trained in combination with the original encoder in the original autoencoder module. Therefore, in order not to affect the network parameters of other modules except the original autoencoder module in the original image processing model, when training the target autoencoder module, the network parameters of the original encoder can be fixed, and only the network parameters of the first decoder can be adjusted, so as to achieve the purpose of not affecting the network parameters of other modules except the original autoencoder module in the original image processing model.

[0054] In this way, when the original decoder in the original image processing model is replaced with the second decoder, the performance of the original encoder and other modules in the target image processing model can also be guaranteed, thereby not affecting the image quality of the target image output by the target image processing model, and there is no need to train other modules except the original autoencoder module.

[0055] As an example, the condition for stopping adjustment may be that the difference between the sample image and the predicted image corresponding to the sample image is lower than a preset difference value.

[0056] As an example, the condition for stopping adjustment may be that the number of times the network parameters of the first decoder are adjusted reaches a preset number.

[0057] In some embodiments, the first decoder is obtained by: obtaining a specified compression condition; and compressing the original decoder according to the specified compression condition to obtain the first decoder.

[0058] The specified compression condition is used to indicate compression of the neural network topology structure and / or compression of the number of feature channels.

[0059] It is worth noting that obtaining the first decoder can be achieved in a variety of ways. The specified compression condition can characterize the way in which the first decoder is obtained. For example, for a neural network model, the number of network layers in the neural network topology structure can be pruned to reduce the complexity of the neural network topology structure, thereby reducing the resources consumed by the neural network model, wherein the neural network topology structure may include the number of network layers, the number of neurons in each layer, and the way in which the neurons are connected to each other. For another example, the number of channels of the input parameters and the number of channels of the output parameters of the network layers in the neural network topology structure can be reduced, thereby reducing the amount of calculation, and further reducing the resources consumed by the neural network model.

[0060] Continuing with the above example, when the specified compression condition is used to indicate compression of the neural network topology, the above step of compressing the original decoder according to the specified compression condition to obtain the first decoder can be implemented in the following manner: pruning the first target network layer of the original decoder according to the specified compression condition; and determining the pruned original decoder as the first decoder. For example, pruning the first target network layer of the original decoder here can be understood as removing the first target network layer from the original decoder, and determining the original decoder after removing the first target network layer as the first decoder.

[0061] As an example, the first target network layer may be an attention network layer. Generally speaking, the attention network layer is a module that consumes a large amount of resources. Therefore, the attention network layer in the original decoder may be pruned to reduce the resources consumed by the first decoder when it is working.

[0062] In the above manner, by pruning the network layers in the original decoder, a first decoder with fewer layers than the original decoder is obtained, thereby achieving the purpose of consuming lower resources when the first decoder is working than the resources consumed when the original decoder is working.

[0063] Following the above example, in the case where the specified compression condition is used to indicate that the number of characteristic channels is compressed, the above step of compressing the original decoder according to the specified compression condition to obtain the first decoder can be implemented in the following manner: compressing the number of characteristic channels of the second target network layer in the original decoder according to the specified compression condition; and determining the original decoder after compressing the number of characteristic channels of the second target network layer in the original decoder as the first decoder. Compressing the number of characteristic channels here can be understood as reducing the number of characteristic channels.

[0064] As an example, the second target network layer may be a convolutional layer.

[0065] In the above manner, by compressing the number of feature channels of the second target network layer in the original decoder, a first decoder with smaller computational complexity than the original decoder is obtained, thereby achieving the purpose of achieving lower resources consumed by the first decoder when working than the resources consumed by the original decoder when working.

[0066] In some embodiments, the original image processing model that completes training may be an image processing model that increases the resolution of an input image. Figure 2 It is a structural schematic diagram of an original image processing model according to an exemplary embodiment of the present disclosure. Figure 2 The figure shows an image processing model based on the infrastructure of the StableDiffusion model, which is used to improve the image resolution. For example, the original image processing model may include an original autoencoder module, a diffusion module and a conditional control module, where the diffusion module and the conditional control module can be understood as other modules in the original image processing model except the original autoencoder module. Among them, the original autoencoder module may include an original encoder and an original decoder, the original encoder compresses the input low-resolution image to the latent space, represents the low-resolution image in a low-dimensional manner, and obtains a first latent vector; the diffusion module is used to perform forward noise diffusion on the first latent variable to generate a second latent variable; the conditional control module understands the text information and the image information of the low-resolution image, and inputs the understanding result into the diffusion module, and uses the diffusion module to perform reverse noise removal on the second latent variable to generate a third latent variable; the third latent variable is decoded by the original decoder to obtain a high-resolution target image.

[0067] The following combination Figure 2 , the process of training the original image processing model of the present disclosure is exemplarily described. The training of the original image processing model includes two parts, one is the original decoder and the training link of the original decoder, and the other is the training link of the diffusion module.

[0068] For the training link of the original decoder and the original decoder, the second sample image is input into the original decoder to obtain a low-dimensional representation of the second sample image, and then the decoder is used to decode the low-dimensional representation of the second sample image, with the goal of restoring the second sample image, and the decoding obtains the restored image. The original decoder and the original decoder are iteratively trained according to the difference between the restored image and the second sample image.

[0069] For the training link of the diffusion module, the original decoder is used to perform a low-dimensional representation of the third sample image, and then the diffusion module is used to perform forward noise diffusion based on the low-dimensional representation to obtain a noise image. The diffusion module is then used in combination with the conditional control module to perform reverse noise removal on the understanding of the text information and the noise image to output predicted noise, and the diffusion module is iteratively trained based on the difference between the predicted noise and the noise added when the diffusion module performs forward noise diffusion. It is worth noting that noise is added multiple times in the forward noise diffusion, and correspondingly, the number of times noise is removed in the reverse noise removal is the same as the number of times noise is added in the forward noise diffusion.

[0070] In some embodiments, after the original image processing model is obtained through training, the trained original image processing model can be tested to obtain test results; and the performance of the trained original image processing model can be evaluated based on the test results. For example, a noise image can be randomly initialized, and the noise image corresponds to the second latent variable mentioned above. Under the guidance of the conditional control module's understanding of text information and the understanding of image information of low-resolution images, the noise image is denoised using the diffusion module, and the denoised noise image is then input into the original decoder to obtain a high-resolution image. Based on the obtained high-resolution image, the performance of the trained original image processing model is evaluated.

[0071] It is worth noting that after obtaining the target image processing model, the above method can also be used to test the target image processing model using the test set. The testing process is the same as the above process and will not be described in detail in this embodiment.

[0072] Figure 3 A block diagram of an image processing model generation device according to an exemplary embodiment of the present disclosure is shown. The image processing model generation device 300 includes:

[0073] A first acquisition module 301 is used to acquire a first decoder and a trained original image processing model, wherein the original image processing model includes an original autoencoding module and other modules except the original autoencoding module, the original autoencoding module includes an original encoder and an original decoder, and the resources used by the original decoder when working are higher than the resources used by the first decoder when working;

[0074] A first replacement module 302, configured to replace an original decoder in the original autoencoder module with the first decoder to obtain a target autoencoder module;

[0075] A training module 303 is used to train the target autoencoder module to obtain a trained second decoder;

[0076] The second replacement module 304 is used to replace the original decoder in the original image processing model with the second decoder to obtain a target image processing model.

[0077] In some embodiments, the training module 303 includes:

[0078] A first acquisition submodule, used to acquire an image training set, wherein the image training set includes a plurality of first sample images;

[0079] A prediction submodule, used for inputting each first sample image into a target autoencoder module to obtain a first predicted image output by the target autoencoder module;

[0080] An adjustment submodule is used to adjust the network parameters of the first decoder based on the difference between the first sample image and the first predicted image corresponding to the first sample image, without changing the network parameters of the original encoder in the target self-encoding module, until the adjustment stop condition is met to obtain a second decoder that has completed training.

[0081] In some embodiments, the first acquisition module 301 includes:

[0082] A second acquisition submodule is used to acquire a specified compression condition, wherein the specified compression condition is used to indicate to compress the neural network topology structure and / or to compress the number of feature channels;

[0083] The first compression submodule is used to compress the original decoder according to the specified compression condition to obtain a first decoder.

[0084] In some embodiments, the specified compression condition is used to indicate that the neural network topology structure is compressed, and the first compression submodule is specifically used to:

[0085] Pruning a first target network layer of the original decoder according to the specified compression condition;

[0086] The pruned original decoder is determined as the first decoder.

[0087] In some embodiments, the specified compression condition is used to indicate compression of the number of feature channels, where the number of feature channels includes the number of input feature channels and / or the number of output feature channels, and the first compression submodule is specifically used to:

[0088] Compressing the number of feature channels of the second target network layer in the original decoder according to the specified compression condition;

[0089] An original decoder after compressing the number of feature channels of the second target network layer in the original decoder is determined as the first decoder.

[0090] In some embodiments, the first target network layer is an attention network layer.

[0091] The implementation of each module in the device 300 may refer to the above-mentioned related embodiments, and this embodiment will not be described in detail here.

[0092] Based on the same inventive concept, an embodiment of the present disclosure provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processing device, the steps of the above method are implemented.

[0093] Based on the same inventive concept, an embodiment of the present disclosure provides an electronic device, including:

[0094] a storage device having a computer program stored thereon;

[0095] A processing device is used to execute the computer program in the storage device to implement the steps of the above method.

[0096] Figure 4 A schematic diagram of the structure of an electronic device according to an exemplary embodiment of the present disclosure. Figure 4 , which shows a schematic diagram of the structure of an electronic device 400 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0097] like Figure 4As shown, the electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0098] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 400 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0099] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 409, or installed from the storage device 408, or installed from the ROM 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0100] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0101] In some embodiments, the electronic device can communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0102] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0103] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: obtains a first decoder and a trained original image processing model, wherein the original image processing model includes an original self-encoding module and other modules except the original self-encoding module, and the original self-encoding module includes an original encoder and an original decoder, and the resources used by the original decoder when working are higher than the resources used by the first decoder when working; replaces the original decoder in the original self-encoding module with the first decoder to obtain a target self-encoding module; trains the target self-encoding module to obtain a trained second decoder; replaces the original decoder in the original image processing model with the second decoder to obtain a target image processing model.

[0104] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0105] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0106] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a module does not, in some cases, limit the module itself.

[0107] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0108] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0109] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0110] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0111] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

Claims

1. A method for generating an image processing model, characterized in that: include: Acquire a first decoder and a trained original image processing model, wherein the original image processing model includes an original self-encoding module and other modules except the original self-encoding module, the original self-encoding module includes an original encoder and an original decoder, and the resources used by the original decoder when working are higher than the resources used by the first decoder when working; Replacing the original decoder in the original autoencoder module with the first decoder to obtain a target autoencoder module; Training the target autoencoder module to obtain a trained second decoder; The original decoder in the original image processing model is replaced with the second decoder to obtain a target image processing model.

2. The method according to claim 1, characterized in that The step of training the target autoencoder module to obtain a trained second decoder includes: Acquire an image training set, wherein the image training set includes a plurality of first sample images; Input each first sample image into a target autoencoder module to obtain a first predicted image output by the target autoencoder module; Based on the difference between the first sample image and the first predicted image corresponding to the first sample image, the network parameters of the first decoder are adjusted without changing the network parameters of the original encoder in the target self-encoding module until the adjustment stop condition is met to obtain a second decoder that has completed training.

3. The method according to claim 1, characterized in that The first decoder is obtained by: Obtaining a specified compression condition, wherein the specified compression condition is used to indicate compressing a neural network topology structure and / or compressing the number of feature channels; The original decoder is compressed according to the specified compression condition to obtain a first decoder.

4. The method according to claim 3, characterized in that The specified compression condition is used to indicate that the neural network topology structure is compressed, and the original decoder is compressed according to the specified compression condition to obtain a first decoder, including: Pruning a first target network layer of the original decoder according to the specified compression condition; The pruned original decoder is determined as the first decoder.

5. The method according to claim 3, characterized in that: The specified compression condition is used to indicate to compress the number of feature channels, the number of feature channels includes the number of input feature channels and / or the number of output feature channels, and the original decoder is compressed according to the specified compression condition to obtain a first decoder, including: Compressing the number of feature channels of the second target network layer in the original decoder according to the specified compression condition; An original decoder after compressing the number of feature channels of the second target network layer in the original decoder is determined as the first decoder.

6. The method according to claim 4, characterized in that The first target network layer is an attention network layer.

7. An image processing model generation device, characterized in that: include: A first acquisition module is used to acquire a first decoder and a trained original image processing model, wherein the original image processing model includes an original self-encoding module and other modules except the original self-encoding module, the original self-encoding module includes an original encoder and an original decoder, and the resources used by the original decoder when working are higher than the resources used by the first decoder when working; A first replacement module, used for replacing an original decoder in the original autoencoder module with the first decoder to obtain a target autoencoder module; A training module, used for training the target autoencoder module to obtain a trained second decoder; The second replacement module is used to replace the original decoder in the original image processing model with the second decoder to obtain a target image processing model.

8. The device according to claim 7, characterized in that The training module includes: A first acquisition submodule, used to acquire an image training set, wherein the image training set includes a plurality of first sample images; A prediction submodule, used for inputting each first sample image into a target autoencoder module to obtain a first predicted image output by the target autoencoder module; An adjustment submodule is used to adjust the network parameters of the first decoder based on the difference between the first sample image and the first predicted image corresponding to the first sample image, without changing the network parameters of the original encoder in the target self-encoding module, until the adjustment stop condition is met to obtain a second decoder that has completed training.

9. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processing device, the steps of the method described in any one of claims 1 to 6 are implemented.

10. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 6.