Device and method for providing service for compressing original model
The apparatus and method for compressing AI models address the inefficiencies of high-performance AI models by applying compression techniques to reduce computational load and power consumption, enabling efficient deployment on mobile and industrial devices while maintaining performance and addressing security and communication issues.
Patent Information
- Application Number
- PCT/KR2023/020595
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-06-02
- Filing Date
- 2023-12-14
- Publication Date
- 2024-12-05
AI Technical Summary
High-performance artificial intelligence models, including deep learning models, have large computational requirements and high power consumption, making them inefficient and costly, especially for deployment on mobile devices and industrial applications.
An apparatus and method for compressing original AI models using a communication unit and a processor that applies various compression techniques to reduce model size, computational load, and power consumption while maintaining or improving performance, utilizing a pre-built AI-based compression model to extract and prioritize techniques based on learning results and user-defined priorities.
The solution enables the creation of a lightweight AI model that can be deployed on mobile devices and industrial equipment, reducing power consumption and unit costs while maintaining performance, and addressing security and communication delays associated with server-based AI technology.
Smart Images

Figure KR2023020595_05122024_PF_FP_ABST
Abstract
Description
Device and method for providing a service for compressing an original model
[0001] The present disclosure relates to a device and method for providing a service of compressing an original model.
[0002] Machine learning (ML) is a branch of artificial intelligence that utilizes artificial neural networks (or neural networks). It refers to the technology that generates new knowledge by inputting data into a computer and allowing it to learn. In particular, remarkable progress has been made in neural networks, a type of machine learning technology, leading to the emergence of deep learning.
[0003] Deep learning is a type of machine learning technology based on artificial neural networks. Even as artificial neural networks become deeper and more multilayered, unsupervised preprocessing of learning data can improve learning efficiency. Deep learning has recently seen rapid progress, driven by the availability of big data via the Internet and the advancements in computing power to process it.
[0004] However, most high-performance AI models, including deep learning, suffer from the weaknesses of large computational loads and high power consumption. To address this, methods for compressing AI learning models are being proposed.
[0005] The purpose of the embodiments disclosed in the present disclosure is to provide a device and method for providing a service of compressing an original model.
[0006] The problems to be solved by the present disclosure are not limited to the problems mentioned above, and other problems not mentioned will be clearly understood by those skilled in the art from the description below.
[0007] A device for providing a service for compressing an original model according to one aspect of the present disclosure for achieving the above-described technical task may include a communication unit and a processor for receiving a request for compression of an artificial intelligence-based original model used by a user from a user's terminal through the communication unit, requesting the user terminal to provide input data for the compression and a purpose of the compression in response to the request, extracting n compression techniques from among m compression techniques according to the priority of the compression purpose using a pre-established artificial intelligence-based compression model (wherein, m and n are natural numbers, m>n), and applying the n compression techniques to the original model to compress the original model.
[0008] In addition, the input data may include at least one of a code for training the original model, data required for the training, a configuration file for identifying the structure of the original model, a code for evaluation, and the original model.
[0009] In addition, the compression purpose includes the performance, computational amount, computational speed, and size of the model, and the compression model can be constructed and updated based on learning results for each of the m compression techniques, the performance, the computational amount, the computational speed, and the size.
[0010] In addition, the processor can extract the n compression techniques having the largest value of the learning result for the first item corresponding to the first rank among the performance, the amount of computation, the computation speed, and the size.
[0011] In addition, the processor can extract nq compression techniques having the largest learning result value for the second item corresponding to the next rank after the first rank, when there are q compression techniques having the largest learning result value for the first item (where q is a natural number smaller than n).
[0012] In addition, the processor may extract a compression technique having the largest value of the learning result for a first item corresponding to the first rank among the performance, the amount of computation, the computation speed, and the size, in proportion to a preset ratio of the first item among the n items, extract a compression technique having the largest value of the learning result for a second item corresponding to the second rank, in proportion to a preset ratio of the second item among the n items, extract a compression technique having the largest value of the learning result for a third item corresponding to the third rank, in proportion to a preset ratio of the third item among the n items, and extract a compression technique having the largest value of the learning result for a fourth item corresponding to the fourth rank, in proportion to a preset ratio of the fourth item among the n items.
[0013] In addition, the processor can calculate the performance improvement degree for each of the m compression techniques based on the performance, the amount of computation, the computation speed, and the learning result values for each size of the m compression techniques, and extract the n compression techniques from among the m compression techniques in descending order of the value obtained by multiplying the performance improvement degree for each compression purpose by the weight for each compression purpose.
[0014] In addition, the processor can compare input data of each of the n compression techniques with input data of the original model, extract one compression technique using input data that is most similar to the input data of the original model, and apply the extracted one compression technique to the original model.
[0015] In addition, the processor may compare input data of each of the n compression techniques with input data of the original model, extract one or more compression techniques using input data having a similarity with the input data of the original model that is greater than a preset value, and apply each of the extracted one or more compression techniques to the original model.
[0016] Additionally, the processor can extract the n compression techniques from among the m compression techniques using graph theory or a graph neural network (GNN) technique.
[0017] In addition, a method for providing a service for compressing an original model according to another aspect of the present disclosure for achieving the above-described technical task may include the steps of receiving a request for compression of an artificial intelligence-based original model used by a user from a user's terminal, a step for requesting provision of input data for the compression and a purpose of the compression to the user terminal in response to the request, a step for extracting n compression techniques from among m compression techniques according to the priority of the compression purpose using a pre-built artificial intelligence-based compression model (wherein, m and n are natural numbers, m>n), and a step for applying the n compression techniques to the original model to compress the original model.
[0018] In addition, a computer program stored in a computer-readable recording medium for executing a method for implementing the present disclosure may be further provided.
[0019] In addition, a computer-readable recording medium recording a computer program for executing a method for implementing the present disclosure may be further provided.
[0020] According to the aforementioned problem solving means of the present disclosure, an optimal compression method can be extracted according to the compression purpose, and the recommended compression method can be applied to the original learning model to reduce the size and structure of the original learning model.
[0021] Additionally, compared to the original learning model, the performance can be maintained relatively the same or improved while reducing the amount of computation.
[0022] Additionally, it can improve computational speed and reduce power consumption compared to the original learning model.
[0023] In addition, by compressing the original learning model, it is possible to improve cost efficiency by eliminating the need for high-performance equipment to embed it and reducing power consumption, and AI technology can be embedded in mobile devices such as general cell phones and Oculus, as well as embedded devices used in industry.
[0024] Additionally, because AI compression technology is embedded in the hardware itself, it can solve problems such as security and communication delay that arise when using AI technology through servers.
[0025] The effects of the present disclosure are not limited to the effects mentioned above, and other effects not mentioned will be clearly understood by those skilled in the art from the description below.
[0026] FIG. 1 is a diagram illustrating a system for providing a service for compressing an original model according to one embodiment of the present disclosure.
[0027] FIG. 2 is a block diagram of a device that provides a service for compressing an original model according to one embodiment of the present disclosure.
[0028] FIG. 3 is a flowchart of a method for providing a service for compressing an original model according to one embodiment of the present disclosure.
[0029] FIG. 4 is a diagram for explaining extraction of a compression technique using graph theory according to one embodiment of the present disclosure.
[0030] FIG. 5 is a diagram for explaining compression result data for each compression technique for learning a compression model according to one embodiment of the present disclosure.
[0031] FIG. 6 is a diagram for explaining compression result data for each compression purpose for learning a compression model according to one embodiment of the present disclosure.
[0032] FIG. 7 is a diagram for explaining ratios according to priorities for compression purposes according to one embodiment of the present disclosure.
[0033] FIG. 8 is a diagram illustrating a learning method of an artificial intelligence learning model according to one embodiment of the present disclosure.
[0034] FIG. 9 is a diagram illustrating a learning method of an artificial intelligence learning model according to one embodiment of the present disclosure.
[0035] Throughout this disclosure, the same reference numerals denote the same components. This disclosure does not describe all elements of the embodiments, and any content that is common in the technical field to which this disclosure pertains or that overlaps between embodiments is omitted. The terms "part, module, element, block" used in the specification may be implemented in software or hardware, and depending on the embodiments, multiple "parts, modules, elements, blocks" may be implemented as a single component, or a single "part, module, element, block" may include multiple components.
[0036] Throughout the specification, when a part is said to be "connected" to another part, this includes not only direct connection but also indirect connection, and indirect connection includes connection via a wireless communication network.
[0037] Additionally, when a part is said to "include" a component, this does not mean that it excludes other components, but rather that it may include other components, unless otherwise specifically stated.
[0038] Throughout the specification, when we say that an element is "on" another element, this includes not only cases where the element is in contact with the other element, but also cases where another element exists between the two elements.
[0039] The terms first, second, etc. are used to distinguish one component from another, and the components are not limited by the aforementioned terms.
[0040] Singular expressions include plural expressions unless the context clearly indicates otherwise.
[0041] The identification codes for each step are used for convenience of explanation and do not describe the order of each step. Each step may be performed in a different order than specified unless the context clearly indicates a specific order.
[0042] The operating principle and embodiments of the present disclosure are described below with reference to the attached drawings.
[0043] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the attached drawings.
[0044] Before proceeding, the meanings of terms used in this specification will be briefly explained. However, it should be noted that the explanation of terms is intended to aid understanding of this specification, and therefore, unless explicitly stated to limit the disclosure, they are not intended to limit the technical concepts of this disclosure.
[0045] As used herein, the term "device" encompasses a variety of devices capable of performing computational processing and providing results to a user. For example, a device may include a computer, a server, or a mobile terminal, or may be any one of these.
[0046] Here, the computer may include, for example, a notebook, desktop, laptop, tablet PC, slate PC, etc. equipped with a web browser.
[0047] The above server device is a server that processes information by communicating with an external device, and may include an application server, a computing server, a database server, a file server, a game server, a mail server, a proxy server, and a web server.
[0048] The above portable terminal may include, for example, a wireless communication device that ensures portability and mobility, and may include all kinds of handheld-based wireless communication devices such as a PCS (Personal Communication System), GSM (Global System for Mobile communications), PDC (Personal Digital Cellular), PHS (Personal Handyphone System), PDA (Personal Digital Assistant), IMT (International Mobile Telecommunication)-2000, CDMA (Code Division Multiple Access)-2000, W-CDMA (W-Code Division Multiple Access), WiBro (Wireless Broadband Internet) terminal, a smart phone, and a wearable device such as a watch, a ring, a bracelet, an anklet, a necklace, glasses, contact lenses, or a head-mounted device (HMD).
[0049] FIG. 1 is a diagram illustrating a system for providing a service for compressing an original model according to one embodiment of the present disclosure.
[0050] Referring to FIG. 1, a system (hereinafter, “system”) for providing a service for compressing an original model according to one embodiment may include a service server (10) and a user terminal (20). However, in some embodiments, the system may include fewer or more components than the components illustrated in FIG. 1.
[0051] The service server (10) may be a server device of a company that provides a service for compressing an artificial intelligence model using various compression techniques.
[0052] When the service server (10) receives a request for compression of an artificial intelligence model (original model) from a user terminal (20), it can extract a compression technique suitable for the original model and perform compression.
[0053] The user terminal (20) may be a terminal device of a user (business or individual) using the model compression service.
[0054] The user terminal (20) may be applied with an information processing means such as a computer, and may include a processor such as a control unit, a photographing means such as a camera, an input / output means including a touch screen, and may mean any device with a communication function. In other words, any device such as a smartphone, tablet, PDA, laptop, or desktop may be applied.
[0055] A user terminal (20) can request compression of an artificial intelligence model (original model) being used by the user to a service server (10). At this time, the user terminal (20) can also transmit input data required for compression to the service server (10).
[0056] The user terminal (20) can receive a compressed model from the service server (10). This allows the user to use a model that is lighter than the original model.
[0057] FIG. 2 is a block diagram of a device that provides a service for compressing an original model according to one embodiment of the present disclosure.
[0058] Referring to FIG. 2, a device (100) (hereinafter, original model compression device) providing a service for compressing an original model may include a communication unit (110), a memory (120), and a processor (130). The processor (130) may include a compression module (131) and a learning module (132). However, in some embodiments, the original model compression device (100) and the processor (130) may include fewer or more components than the components illustrated in FIG. 2. The original model compression device (100) to be described with reference to FIG. 2 may be the service server (10) described with reference to FIG. 1 above.
[0059] The communication unit (110) may include one or more modules that enable wireless or wired communication between the original model compression device (100) and the user terminal (20), between the original model compression device (100) and an external device (not shown), and between the original model compression device (100) and a communication network. For example, it may include at least one of a wired communication module, a wireless communication module, a short-range communication module, and a location information module.
[0060] The communication network can use various types of communication networks, for example, wireless communication methods such as WLAN (Wireless LAN), Wi-Fi, Wibro, WiMAX, and HSDPA (High Speed Downlink Packet Access), or wired communication methods such as Ethernet, xDSL (ADSL, VDSL), HFC (Hybrid Fiber Coax), FTTC (Fiber to The Curb), and FTTH (Fiber to The Home) can be used.
[0061] Meanwhile, the communication network is not limited to the communication methods presented above, and may include all other widely known or future-developed communication methods in addition to the above-described communication methods.
[0062] The wired communication module may include various wired communication modules such as a Local Area Network (LAN) module, a Wide Area Network (WAN) module, or a Value Added Network (VAN) module, as well as various cable communication modules such as a Universal Serial Bus (USB), a High Definition Multimedia Interface (HDMI), a Digital Visual Interface (DVI), RS-232 (recommended standard 232), power line communication, or plain old telephone service (POTS).
[0063] The wireless communication module may include a wireless communication module that supports various wireless communication methods such as GSM (global System for Mobile Communication), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), UMTS (universal mobile telecommunications system), TDMA (Time Division Multiple Access), LTE (Long Term Evolution), 4G, 5G, and 6G, in addition to a WiFi module and a Wireless Broadband module.
[0064] The short-range communication module is for short-range communication, and can support short-range communication using at least one of Bluetooth™, RFID (Radio Frequency Identification), Infrared Data Association (IrDA), UWB (Ultra Wideband), ZigBee, NFC (Near Field Communication), Wi-Fi (Wireless-Fidelity), Wi-Fi Direct, and Wireless USB (Wireless Universal Serial Bus) technologies.
[0065] The memory (120) may store at least one process for providing a service of compressing the original model.
[0066] The memory (120) may store a plurality of compression techniques for providing a service of compressing an original model, results of applying the compression techniques, and an artificial intelligence model (compressed model) built by learning these techniques.
[0067] The memory (120) can store data supporting various functions of the original model compression device (100), a program for the operation of the processor (130), can store input / output data (e.g., music files, still images, moving images, etc.), and can store a plurality of application programs (or applications) run on the original model compression device (100), data for the operation of the original model compression device (100), and commands. At least some of these application programs can be downloaded from an external server via wireless communication.
[0068] The memory (120) may include at least one type of storage medium among a flash memory type, a hard disk type, an SSD (Solid State Disk type), an SDD (Silicon Disk Drive type), a multimedia card micro type, a card type memory (e.g., SD or XD memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, and an optical disk. In addition, the memory (120) is separate from the original model compression device (100), but may be a database connected by wire or wirelessly.
[0069] The processor (130) may perform the aforementioned operations using a memory that stores data regarding an algorithm for controlling the operation of components within the original model compression device (100) or a program that reproduces the algorithm, and data stored in the memory. In this case, the memory and the processor (130) may each be implemented as separate chips. Alternatively, the memory and the processor (130) may be implemented as a single chip.
[0070] The compression module (131) of the processor (130) is a module that performs operations related to compression of the original model. Specifically, the compression module (131) can perform compression on the original model for which compression has been requested using a previously constructed compression model.
[0071] The learning module (132) of the processor (130) is a module that performs operations related to learning a compression model. Specifically, the learning module (132) can classify compression results obtained by applying multiple compression techniques according to the compression purpose, thereby constructing and updating a compression model.
[0072] In addition, the processor (130) can control any one or a combination of the components discussed above to implement various embodiments according to the present disclosure described in FIGS. 3 to 7 below on the original model compression device (100).
[0073] Hereinafter, a method for compressing the original model will be specifically described with reference to FIGS. 3 to 7.
[0074] FIG. 3 is a flowchart of a method for providing a service for compressing an original model according to one embodiment of the present disclosure.
[0075] FIG. 4 is a diagram for explaining extraction of a compression technique using graph theory according to one embodiment of the present disclosure.
[0076] FIG. 5 is a diagram for explaining compression result data for each compression technique for learning a compression model according to one embodiment of the present disclosure.
[0077] FIG. 6 is a diagram for explaining compression result data for each compression purpose for learning a compression model according to one embodiment of the present disclosure.
[0078] FIG. 7 is a diagram for explaining ratios according to priorities for compression purposes according to one embodiment of the present disclosure.
[0079] The method of FIG. 3 may be performed by the original model compression device (100) disclosed in FIG. 2, but is not limited thereto and may also be performed by the service providing server (10) disclosed in FIG. 1, or may be performed by another external device.
[0080] In addition, for convenience of explanation, each step is described below as being performed by the processor (130), but each step can be understood as being performed by any one of the compression module (131), learning module (132) included in the processor (130) and modules not shown in FIG. 2.
[0081] Referring to FIG. 3, the processor (130) of the original model compression device (100) can receive a request for compression of an artificial intelligence-based original model used by a user from the user's terminal (20) through the communication unit (110) (S310).
[0082] Users use AI models that they have built themselves or received from external sources for certain purposes, such as providing specific services. However, AI models require a large amount of computation and are large in size, requiring high-spec PCs and devices. In addition, the large amount of computation requires high power consumption, which can be a burden in terms of unit cost.
[0083] Therefore, users can request compression of the original model to make the AI model they use (original model) lighter.
[0084] In response to the request, the processor (130) of the original model compression device (100) may request the user terminal (10) to provide input data for the compression and the purpose of the compression (S320).
[0085] When requesting compression, users must provide the data required for compression to the processor (130). The processor (130) can use the provided data to more accurately extract a compression technique suitable for the original model and proceed with compression.
[0086] Here, the input data may include at least one of a code for training the original model, data required for training, a configuration file for identifying the structure of the original model, code for evaluation, and the original model.
[0087] That is, users can provide existing designs and AI models they have used (original models) and the code that can use them as input data.
[0088] In some embodiments, the processor (130) may use the input data to identify a representative model of the original model. For example, the representative model may be, but is not limited to, a convolutional neural network (CNN), a deep neural network (DNN), a recurrent neural network (RNN), or a reinforcement learning (RL).
[0089] Here, compression objectives may include, but are not limited to, model performance, computational load, computational speed, and size.
[0090] Users may have different goals for compressing the original model. For example, some users may aim to improve the performance of the original model, others may aim to reduce the model's computational load, others may aim to increase the model's computational speed, and still others may aim to reduce the model's size. The processor (130) can extract a compression technique appropriate to the user's model compression goal and perform the compression.
[0091] Additionally, when requesting compression purpose input from the user terminal (20), the processor (130) may further request priority input of the compression purpose.
[0092] Users can prioritize the models based on their perceived priority. For example, they can prioritize performance, computational speed, computational load, and size. The processor (130) can extract a compression technique appropriate for the user's model compression purpose, taking into account the compression priority, and then perform compression.
[0093] The processor (130) of the original model compression device (100) can extract n compression techniques from among m compression techniques according to the priority of the compression purpose using the pre-built artificial intelligence-based compression model (S330). Here, m and n are natural numbers, and m is greater than n.
[0094] Here, the compression model can be built and updated based on the learning results (compression results) for each of the m compression techniques in terms of the performance, the amount of computation, the computation speed, and the size.
[0095] The processor (130) can build and update a compression model by accumulating the results (tasks) of compression requested from previous or current users and learning by m compression techniques and compression purposes.
[0096] That is, the processor (130) can learn by compressing the results (i tasks) of multiple artificial intelligence models (i artificial intelligence models, where i is a natural number greater than or equal to 2) into data for each of m compression techniques. As illustrated in Fig. 5, for compression technique C1, the result values for each compression purpose of each of i tasks can be learned, and for Cm, the result values for each compression purpose of each of i tasks can be learned.
[0097] In addition, the processor (130) can learn by converting the compressed results (i tasks) of multiple artificial intelligence models (i artificial intelligence models, where i is a natural number greater than or equal to 2) into data for multiple compression purposes. As illustrated in FIG. 6, the result values for each compression technique of each i task can be learned for the performance among compression purposes, the result values for each compression technique of each i task can be learned for the amount of computation among compression purposes, the result values for each compression technique of each i task can be learned for the computation speed among compression purposes, and the result values for each compression technique of each i task can be learned for the size among compression purposes.
[0098] In some embodiments, the compression model may extract compression techniques based on graph theory or a graph neural network (GNN) technique. That is, the processor (130) may extract the n compression techniques from among the m compression techniques using graph theory or a graph neural network (GNN) technique.
[0099] Referring to Fig. 4, each of the m compression techniques is configured as a node. The processor (130) can extract n compression techniques according to the connection relationship between each of the m compression techniques based on the compression purpose of the original model. More specifically, the processor (130) can extract n compression techniques according to the connection relationship between each of the m compression techniques based on the priority of the compression purpose.
[0100] Below, a method for extracting n compression techniques from m compression techniques according to the priority of compression purpose is described in detail.
[0101] In one embodiment, the processor (130) can extract n compression techniques having the largest learning result value for the first item corresponding to the first priority among the performance, the amount of computation, the computation speed, and the size. As described above, since the compression model has learned learning result values for each of the m compression techniques and compression purposes, the processor (130) can extract the compression technique having the largest result value for the compression purpose corresponding to the first priority among the priorities input by the user.
[0102] At this time, when the compression technique with the largest result value of the compression purpose corresponding to the first rank cannot fill n, the processor (130) can sequentially fill the remaining number with the compression technique with the largest result value of the compression purpose corresponding to the next rank.
[0103] That is, when the number of compression techniques having the largest learning result values for the first item is q (wherein q is a natural number smaller than n), the processor (130) can extract nq compression techniques having the largest learning result values for the second item corresponding to the next rank after the first rank. For example, when n is 5 and q is 3 (i.e., when only 3 compression techniques having the largest learning result values for the first item are extracted), 2 compression techniques having the largest learning result values for the second item can be extracted.
[0104] In this way, even if the compression technique for the compression purpose corresponding to the previous priority is extracted, if n is not filled, the compression technique for the compression purpose corresponding to the next priority is sequentially extracted, so that n compression techniques can be finally extracted. However, the present invention is not limited thereto, and depending on the embodiment, even if n compression techniques are not extracted, the extraction operation may not be performed from a certain priority. For example, if n is 10, 8 compression techniques for the compression purposes up to the 1st and 2nd priorities are extracted, and even if 2 are not enough, the compression techniques may not be extracted from the 3rd priority and later (i.e., the final 8 compression techniques are extracted).
[0105] In another embodiment, the processor (130) may extract a compression technique having the largest value of the learning result for a first item corresponding to the first rank among the performance, the amount of computation, the computation speed, and the size, in proportion to a preset ratio of the first item among the n items, extract a compression technique having the largest value of the learning result for a second item corresponding to the second rank, in proportion to a preset ratio of the second item among the n items, extract a compression technique having the largest value of the learning result for a third item corresponding to the third rank, in proportion to a preset ratio of the third item among the n items, and extract a compression technique having the largest value of the learning result for a fourth item corresponding to the fourth rank, in proportion to a preset ratio of the fourth item among the n items.
[0106] Referring to FIG. 7, when the priorities are set in the order of performance, amount of computation, computation speed, and size, and the ratios are set to 0.4, 0.3, 0.2, and 0.1, respectively, and n is 10, the processor (130) can extract four compression techniques having the largest value of performance as the first priority, three compression techniques having the largest value of amount of computation as the second priority, two compression techniques having the largest value of computation speed as the third priority, and one compression technique having the largest value of size as the fourth priority.
[0107] Depending on the embodiment, the ratio for a lower order (e.g., the fourth order size) may be set to 0, so that the compression technique for that order may not be extracted.
[0108] In addition, according to an embodiment, among m compression techniques that assign weights to priorities for the compression purpose, n compression techniques may be recommended. For example, if a weight of 0.4 is assigned to the first priority, a weight of 0.3 is assigned to the second priority, a weight of 0.2 is assigned to the third priority, and a weight of 0.1 is assigned to the fourth priority, the processor (130) may calculate the result values for each compression purpose of the m compression techniques by applying weights according to priorities, and extract n compression techniques in order of the highest values.
[0109] In addition, according to an embodiment, the processor (130) may calculate the performance improvement for each of the m compression techniques based on the learning result values for each compression purpose (performance, amount of computation, computation speed, and size) of the m compression techniques, and may extract n compression techniques from among the m compression techniques in descending order of the value obtained by multiplying the performance improvement for each compression purpose by the weight for each compression purpose.
[0110] That is, the processor (130) compares the performance of the original model with the performance of the model to which the compression technique is applied, calculates the performance improvement for each compression purpose of the compression technique, and extracts n compression techniques from among m compression techniques based on the calculated performance improvement for each compression purpose.
[0111] For example, if the performance improvement of a specific compression technique is calculated as 3% in performance, 15% in computational volume, 10% in computational speed, and 1% in size for each compression purpose, and the preset weights for each compression purpose are 0.4 for performance as the first priority, 0.3 for computational volume as the second priority, 0.2 for computational speed as the third priority, and 0.1 for size as the fourth priority, then the result value of the specific compression technique can be calculated as 0.4*3+0.3*15+0.2*10+0.1*1=7.8. In this way, the value obtained by multiplying the performance improvement and the weights for m compression techniques is calculated, and the m result values are listed in descending order, and the top n compression techniques can be extracted and recommended to the user.
[0112] The processor (130) of the original model compression device (100) can compress the original model by applying the n compression techniques to the original model (S340).
[0113] The processor (130) can apply the extracted n compression techniques to the original model, respectively, to generate n compressed models, and provide them to the user terminal (20). When n is 2 or more, the user can check two or more compressed models and select and use one that is more usable or suitable for application to the service.
[0114] In addition, the processor (130) can provide a configuration file for each compressed model to the user terminal (20). That is, the compressed model is made lighter by applying a compression technique to the original model, and since its detailed configuration is different from that of the original model, the configuration file is provided together to the user terminal (20).
[0115] In the above, it has been described that n compressed models are created by applying all of the extracted n compression techniques to the original model and provided to the user, but this is not limited thereto, and the present disclosure may perform compression by re-extracting one or more compression techniques according to similarity among the extracted n compression techniques.
[0116] In one embodiment, the processor (130) may compare the input data of each of the n compression techniques with the input data of the original model, extract one compression technique using input data that is most similar to the input data of the original model, and apply the extracted compression technique to the original model.
[0117] As described above, a compression model can be built and updated by accumulating the results (tasks) of compression requests from previous or current users and learning for each of the m compression techniques and compression purposes. When a compression request is received from a user, input data for model compression is also provided, and the compression model learns for each compression technique and compression purpose using the provided input data.
[0118] The processor (130) compares the input data used for compression with the input data of the original model for each compression technique, and as a result of the comparison, can extract one compression technique using the input data with the greatest similarity between the two among n compression techniques.
[0119] In another embodiment, the processor (130) may compare input data of each of the n compression techniques with input data of the original model, extract one or more compression techniques using input data having a similarity with the input data of the original model that is greater than or equal to a preset value, and apply each of the extracted one or more compression techniques to the original model.
[0120] For example, the processor (130) compares the input data used for compression with the input data of the original model for each compression technique, and if, as a result of the comparison, there are three compression techniques using input data with a similarity between the two of 10 compression techniques of 90 percent or more, the three compression techniques can be extracted.
[0121] Additionally, depending on the embodiment, the extrusion technique may be extracted based on the similarity between representative models rather than the similarity between input data. As described above, the representative model can be identified using the input data.
[0122] In one embodiment, the processor (130) may compare the representative model of each of the n compression techniques with the representative model of the original model, extract one compression technique using the representative model most similar to the representative model of the original model, and apply the extracted compression technique to the original model.
[0123] In another embodiment, the processor (130) may compare a representative model of each of the n compression techniques with a representative model of the original model, extract one or more compression techniques using a representative model having a similarity with the representative model of the original model that is greater than a preset value, and apply each of the extracted one or more compression techniques to the original model.
[0124] Hereinafter, a learning method of the compression model of the present disclosure will be described with reference to FIGS. 8 and 9.
[0125] FIG. 8 is a diagram illustrating a learning method for an artificial intelligence learning model (NN) (e.g., a compression model) according to one embodiment of the present disclosure. Specifically, FIG. 8 illustrates the structure of a convolutional neural network (CNN), as an example of a neural network structure.
[0126] Referring to FIG. 8, the artificial intelligence learning model (NN) may include a plurality of layers (L1 to Ln). Each of the plurality of layers (L1 to Ln) may be a linear layer or a non-linear layer, and in one embodiment, at least one linear layer and at least one non-linear layer may be combined and referred to as one layer. For example, the linear layer may include a convolution layer and a fully connected layer, and the non-linear layer may include a pooling layer and an activation layer.
[0127] For example, the first layer (L1) may be a convolutional layer, the second layer (L2) may be a pooling layer, and the nth layer (Ln) may be a fully connected layer serving as an output layer. An artificial intelligence learning model (NN) may further include activation layers and layers that perform other types of operations.
[0128] Each of the plurality of layers (L1 to Ln) can receive input data (e.g., an image frame) or a feature map generated from a previous layer as an input feature map, and generate output data (QR) by operating on the input feature map. In one embodiment, the output data (QR) can be various network parameters (mean value, probability weight, standard deviation).
[0129] A feature map refers to data that expresses various characteristics of input data. The feature maps (FM1, FM2, FMn) may have, for example, a two-dimensional matrix or a three-dimensional matrix (or tensor) form. In one embodiment, the first feature map (FM1) input may be data corresponding to a current state. The feature maps (FM1, FM2, FMn) have a width (W) (or column), a height (H) (or row), and a depth (D), which may correspond to the x-axis, y-axis, and z-axis on a coordinate system, respectively. In this case, the depth (D) may be referred to as the number of channels.
[0130] The first layer (L1) can generate the second feature map (FM2) by convolving the first feature map (FM1) with a weight kernel (WK). The weight kernel (WK) can filter the first feature map (FM1) and may also be referred to as a filter or a map. The depth of the weight kernel (WK), i.e., the number of channels, is the same as the depth of the first feature map (FM1), i.e., the number of channels, and the same channels of the weight kernel (WK) and the first feature map (FM1) can be convolved. The weight kernel (WK) can be shifted in a manner that traverses the first feature map (FM1) using a sliding window. The amount of shifting can be referred to as a "stride length" or "stride."
[0131] During each shift, each of the weight values included in the weight kernel (WK) may be multiplied and added to all pixel data in the area overlapping with the first feature map (FM1). The data of the first feature map (FM1) in the area where each of the weight values included in the weight kernel (WK) overlaps with the first feature map (FM1) may be referred to as extracted data. As the first feature map (FM1) and the weight kernel (WK) are convolved, one channel of the second feature map (FM2) may be generated. That is, a plurality of weight maps may be convolved with the first feature map (FM1) to generate a plurality of channels of the second feature map (FM2). In other words, the number of channels of the second feature map (FM2) may correspond to the number of weight maps.
[0132] The second layer (L2) can generate a third feature map (FM3) by changing the spatial size of the second feature map (FM2) through pooling. Pooling may be referred to as sampling or down-sampling. A two-dimensional pooling window (PW) is shifted on the second feature map (FM2) in units of the size of the pooling window (PW), and the maximum value (or the average value of the pixel data) among the pixel data in the area overlapping with the pooling window (PW) may be selected. Accordingly, a third feature map (FM3) with a changed spatial size may be generated from the second feature map (FM2). The number of channels of the third feature map (FM3) is the same as the number of channels of the second feature map (FM2). In one embodiment, the third feature map (FM3) may correspond to an output feature map on which convolution is completed.
[0133] The nth layer (Ln) can classify the class (CL) of input data by combining the features of the nth feature map (FMn). In addition, the nth layer (Ln) can generate output data (QR) corresponding to the class. In an embodiment, the input data may correspond to data corresponding to the current state, and the nth layer (Ln) can generate output data (QR) for determining an optimal action by extracting classes corresponding to multiple actions from the nth feature map (FMn) provided from the previous layer.
[0134] FIG. 9 is a diagram showing a learning method of an artificial intelligence learning model (NN of FIG. 8) according to one embodiment of the present disclosure.
[0135] Referring to FIG. 9, input feature maps (201) include D channels, and the input feature map of each channel may have a size of H rows and W columns (D, H, W are natural numbers). Each of the kernels (202) has a size of R rows and S columns, and the kernels (202) may include a number of channels corresponding to the number of channels (or depth) (D) of the input feature maps (201) (R, S are natural numbers). Output feature maps (203) may be generated through a 3D convolution operation between the input feature maps (201) and the kernels (202), and may include Y channels depending on the convolution operation.
[0136] The process of generating an output feature map through a convolution operation between one input feature map and one kernel can be explained with reference to FIG. 8, and by performing a two-dimensional convolution operation between input feature maps (201) of all channels and kernels (202) of all channels, output feature maps (203) of all channels can be generated.
[0137] Referring back to FIG. 9, for convenience of explanation, it is assumed that the input feature map (210) has a size of 6x6, the original kernel (220) has a size of 3x3, and the output feature map (230) has a size of 4x4, but this is not limited thereto, and the artificial intelligence learning model (NN of FIG. 8) can be implemented with feature maps and kernels of various sizes. In addition, the values defined in the input feature map (210), the original kernel (220), and the output feature map (230) are all exemplary values, and embodiments according to the present disclosure are not limited thereto.
[0138] The original kernel (220) can perform a convolution operation by sliding in a 3x3 window unit on the input feature map (210). The convolution operation can represent an operation for obtaining each feature data of the output feature map (230) by summing all values obtained by multiplying each feature data of a window of the input feature map (210) and each weight value of a corresponding position in the original kernel (220).
[0139] In other words, a convolution operation between one input feature map (210) and one original kernel (220) can be processed by repeatedly performing multiplication of extracted data of the input feature map (210) and corresponding weight values of the original kernel (220) and summing of the multiplication results, and an output feature map (230) can be generated as a result of the convolution operation.
[0140] Below, we will describe the code for the original model before the compression technique of the present disclosure is applied, the original model compressed by applying the compression technique, and the compression model that applies the compression technique to the original model. For convenience of explanation, the original model described below is described as being randomly generated by referencing an external library. However, in reality, the original model may be an artificial intelligence model used by the user requesting compression as described above.
[0141] The code for creating the original model is as shown in [Figure 1] below. Additionally, the original model can create a neural network layer via self.make_layers() , and the code for creating the neural network layer is as shown in [Figure 2] below. Additionally, if init_weights is True in [Figure 1], the initialize_weights() function is called, and the corresponding function is as shown in [Figure 3] below.
[0142] [Figure 1]
[0143]
[0144] [Figure 2]
[0145]
[0146] [Figure 3]
[0147]
[0148] When the code for creating the original model in [Figure 1] is executed, the code for creating the layer in [Figure 2] and the code for setting the weight in [Figure 3] are executed together.
[0149] The original model generated in this way can be compressed and reduced in weight by applying compression techniques. Referring to [Figure 4] below, the compression technique can be applied using the compression_ai.pruning() function.
[0150] [Figure 4]
[0151]
[0152] The code for this compressed model is as shown in [Figure 5] below.
[0153] [Figure 5]
[0154]
[0155] Although FIG. 3 describes the steps as being executed sequentially, this is merely an example of the technical idea of the present embodiment, and a person having ordinary skill in the technical field to which the present embodiment belongs can modify and apply various modifications and variations by changing the order described in FIG. 3 or executing them in parallel without departing from the essential characteristics of the present embodiment, and therefore FIG. 3 is not limited to a chronological order.
[0156] Meanwhile, in the above description, the steps described in FIG. 3 may be further divided into additional steps or combined into fewer steps, depending on the implementation example of the present disclosure. Furthermore, some steps may be omitted as needed, and the order of the steps may be changed.
[0157] Meanwhile, the disclosed embodiments may be implemented in the form of a recording medium storing computer-executable instructions. The instructions may be stored in the form of program code, and when executed by a processor, may generate program modules to perform the operations of the disclosed embodiments. The recording medium may be implemented as a computer-readable recording medium.
[0158] Computer-readable storage media include all types of storage media that store instructions that can be deciphered by a computer. Examples include read-only memory (ROM), random access memory (RAM), magnetic tape, magnetic disks, flash memory, and optical data storage devices.
[0159] The disclosed embodiments have been described with reference to the attached drawings as described above. Those skilled in the art will understand that the present disclosure can be implemented in forms other than the disclosed embodiments without altering the technical spirit or essential features of the present disclosure. The disclosed embodiments are illustrative and should not be construed as limiting.
Claims
1. Ministry of Communications; and A device for providing a service for compressing an original model, comprising: a processor for receiving a request for compression of an artificial intelligence-based original model used by a user from a user's terminal through the communication unit, requesting the user terminal to provide input data for the compression and the purpose of the compression in response to the request, extracting n compression techniques from among m compression techniques according to the priority of the compression purpose using a pre-established artificial intelligence-based compression model (wherein, m and n are natural numbers, m>n), and applying the n compression techniques to the original model to compress the original model; 2. In paragraph 1, A device that provides a service for compressing an original model, wherein the input data includes at least one of a code for training the original model, data required for the training, a configuration file for identifying the structure of the original model, a code for evaluation, and the original model.
3. In paragraph 1, The above compression objectives include the model's performance, computational volume, computational speed and size, A device that provides a service for compressing an original model, wherein the compression model is constructed and updated based on learning results for each of the m compression techniques, the performance, the amount of computation, the computation speed, and the size.
4. In paragraph 3, The above processor, A device providing a service for compressing an original model by extracting n compression techniques having the largest value of the learning result for the first item corresponding to the first rank among the performance, the amount of computation, the computation speed, and the size.
5. In paragraph 4, The above processor, A device providing a service for compressing an original model, extracting nq compression techniques having the largest learning result values for the second item corresponding to the next rank after the first rank, when there are q compression techniques having the largest learning result values for the first item (where q is a natural number less than n).
6. In paragraph 3, The above processor, A device providing a service for compressing an original model, wherein the compression technique having the largest value of the learning result for the first item corresponding to the first rank among the performance, the amount of computation, the computation speed, and the size is extracted in proportion to the preset ratio of the first item among the n items, the compression technique having the largest value of the learning result for the second item corresponding to the second rank is extracted in proportion to the preset ratio of the second item among the n items, the compression technique having the largest value of the learning result for the third item corresponding to the third rank is extracted in proportion to the preset ratio of the third item among the n items, and the compression technique having the largest value of the learning result for the fourth item corresponding to the fourth rank is extracted in proportion to the preset ratio of the fourth item among the n items.
7. In paragraph 3, The above processor, A device providing a service for compressing an original model, wherein the device calculates the performance improvement for each compression purpose of the m compression techniques based on the performance, the amount of computation, the computation speed, and the learning result values for each size of the m compression techniques, and extracts the n compression techniques from among the m compression techniques in the order of the product of the performance improvement for each compression purpose and the weight for each compression purpose.
8. In paragraph 1, The above processor, A device providing a service for compressing an original model by comparing the input data of each of the n compression techniques with the input data of the original model, extracting one compression technique using input data most similar to the input data of the original model, and applying the extracted one compression technique to the original model.
9. In paragraph 1, The above processor, A device providing a service for compressing an original model by comparing input data of each of the n compression techniques with input data of the original model, extracting one or more compression techniques using input data having a similarity with the input data of the original model that is greater than a preset value, and applying each of the extracted one or more compression techniques to the original model.
10. In paragraph 1, The above processor, A device that provides a service for compressing an original model by extracting n compression techniques from among the m compression techniques using graph theory or a graph neural network (GNN) technique.
11. In a method performed by a device, A step of receiving a compression request for an artificial intelligence-based original model used by the user from the user's terminal; In response to the above request, a step of requesting the user terminal to provide input data for the compression and the purpose of the compression; A step of extracting n compression techniques from among m compression techniques according to the priority of the compression purpose using a pre-built artificial intelligence-based compression model (wherein, m and n are natural numbers, m>n); and A method for providing a service for compressing an original model, comprising: a step of compressing the original model by applying the n compression techniques to the original model.
Citation Information
Patent Citations
Organic electroluminescent materials and devices
KR1020220164438A
Semiconductor device
KR1020240030590A
Method and apparatus for providing performance content
KR1020240126499A
Apparatus and method for compression of neural network model
KR102442928B1
