Processing system, processing method, and processing program
The system addresses edge computing inefficiencies by adapting quantization parameters based on confidence levels and task requirements, optimizing data transmission and maintaining accuracy for edge and server device interactions.
Patent Information
- Application Number
- JP2021112405
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-07-06
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-07-06
AI Technical Summary
Existing edge computing systems face inefficiencies when handling complex tasks due to strained processing capacity, leading to delays in tasks requiring quick responses, and existing data compression methods lack adaptability in setting quantization parameters for diverse data and tasks between edge and server devices.
A processing system that uses an edge device with a lightweight model and a server device with a high-precision model, dynamically adapting quantization parameters based on confidence levels and task requirements, allowing data to be processed efficiently between the two devices.
The system effectively reduces data transmission while maintaining inference accuracy by adaptively setting quantization parameters, enabling real-time high-precision operations in applications like surveillance and autonomous driving.
Smart Images

Figure 0007546254000005 
Figure 0007546254000011 
Figure 0007546254000013
Abstract
Description
[Technical field]
[0001] The present invention relates to a processing system, a processing method, and a processing program. [Background technology]
[0002] As typified by edge computing, technologies that perform processing on edge devices closer to users, rather than consolidating data and calculations in server devices, are beginning to be put into practical use.
[0003] However, it is not necessarily efficient to perform all calculations on an edge device. For example, when an edge device is used to perform a difficult task that requires a large amount of calculations, the processing capacity of the edge device may be strained, resulting in disadvantages such as delays in other tasks that require a fast response. As a result, there is a technology for adaptively sharing processing between an edge device and a server device that controls whether the result processed by the edge device is returned to the user or the result is transmitted to the server and processed by the server device and returned to the user, depending on the degree of certainty of the result of processing a task by the edge device (see Non-Patent Document 1). [Prior art documents] [Non-patent literature]
[0004] [Non-Patent Document 1] Noboru Enomoto, "Accelerating Deep Learning Inference Using Model Cascade", IEICE Technical Report, vol. 119, no. 481, PRMU2019-98, pp. 203-208, March 2020. Summary of the Invention [Problem to be solved by the invention]
[0005] Here, consider a case where an edge device and a server device share processing to process a task, and data related to the task is compressed when it is transmitted from the edge device to the server device. Many methods for compressing data include a quantization process, but the quantization performed at this time often only allows changes to the quantization parameter within a range that can be used universally. However, since the types of data and tasks shared between the edge device and the server device are diverse, there has been a demand for adaptively setting the quantization parameter according to the type of data and the task.
[0006] The present invention has been made in consideration of the above, and aims to provide a processing system, a processing method, and a processing program that can adaptively set a quantization parameter in the quantization of transferred data that is performed when transferring data from an edge device to a server device. [Means for solving the problem]
[0007] In order to solve the above-mentioned problems and achieve the object, a processing system according to the present invention is a processing system performed using an edge device and a server device, the edge device having a first inference unit that uses a first model to extract features of data and executes inference processing on the data based on the extracted features, a determination unit that determines whether to output the inference result by the first inference unit if a confidence level for the inference result by the first inference unit is equal to or higher than a threshold, and to output the features of the data to the server device if the confidence level is less than the threshold, and a quantization unit that quantizes and outputs the features of the data extracted by the first inference unit, and the server device has a second model having higher inference accuracy than the first model. and a second inference unit that performs inference processing on the data based on the feature quantities of the data output from the edge device using the quantization unit, and the processing system is characterized by having an inference accuracy acquisition unit that acquires the accuracy of each inference result estimated by the second inference unit based on each feature quantity of the sampling data quantized by the quantization unit with different quantization bit numbers, a first information amount calculation unit that calculates an information amount of each feature quantity of the sampling data quantized by the quantization unit with different quantization bit numbers, and a first setting unit that sets an initial number of quantum bits in the quantization unit based on each information amount calculated by the first information amount calculation unit and the accuracy of each inference result acquired by the inference accuracy acquisition unit. Effect of the Invention
[0008] According to the present invention, it is possible to adaptively set a quantization parameter for quantizing transfer data, which is executed when transferring data from an edge device to a server device. [Brief description of the drawings]
[0009] [Figure 1] FIG. 1 is a diagram for explaining an outline of a processing method of the processing system according to the first embodiment. [Diagram 2] FIG. 2 is a diagram illustrating an example of a configuration of the processing system according to the first embodiment. [Diagram 3] FIG. 3 is a diagram for explaining the process of setting the initial number of quantum bits. [Figure 4]FIG. 4 is a sequence diagram showing the procedure of the process of setting the initial number of quantization bits. [Diagram 5] FIG. 5 is a sequence diagram illustrating a processing procedure of the inference processing according to the first embodiment. [Figure 6] FIG. 6 is a diagram illustrating another example of the configuration of the processing system according to the first embodiment. In FIG. [Figure 7] FIG. 7 is a diagram illustrating another example of the configuration of the processing system according to the first embodiment. In FIG. [Figure 8] FIG. 8 is a diagram illustrating an example of a configuration of a processing system according to the second embodiment. [Figure 9] FIG. 9 is a diagram illustrating the process of optimizing the number of quantum bits in the operation stage. [Figure 10] FIG. 10 is a flowchart showing a procedure for setting the quantization bitrate in the operation stage. [Figure 11] FIG. 11 is a diagram illustrating an example of a computer that realizes an edge device, a server device, and a setting device by executing a program. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0010] Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings. Note that the present invention is not limited to this embodiment. In addition, in the description of the drawings, the same parts are indicated by the same reference numerals. Note that, hereinafter, when "-A" is written for A, it is equivalent to "a symbol with "-" written immediately above "A".
[0011] [Embodiment 1] [Outline of the first embodiment] A first embodiment of the present invention will be described. In the first embodiment of the present invention, a processing system that performs inference processing using a trained high-precision model and a lightweight model will be described. Note that in the processing system of the embodiment, a case where a DNN (Deep Neural Network) is used as a model used in the inference processing will be described as an example. In the processing system of the first embodiment, any neural network may be used, and low-computational-amount signal processing and high-computational-amount signal processing may be used instead of the trained model.
[0012] 1 is a diagram for explaining an outline of a processing method of a processing system according to the first embodiment. In the processing system according to the first embodiment, a high-precision model and a lightweight model form a model cascade. In this processing system, a confidence factor is used to control whether processing is to be performed in an edge device using a high-speed, low-precision lightweight model (e.g., DNN1 (first model)) or in a cloud (server device) using a low-speed, high-precision high-precision model (e.g., DNN2 (second model)).
[0013] For example, a server device is a device that is located in a place that is logically far away compared to an edge device. An edge device is an IoT device or various terminal devices that are located in a place that is physically and logically close to a user, and has fewer resources than a server device.
[0014] DNN1 and DNN2 are models that output inference results based on input data. In the example in Figure 1, DNN1 takes an image as input, and infers the probability of each class of object appearing in the image based on features extracted from the image. DNN2 takes the features extracted by DNN1 (hereinafter referred to as feature map) as input, and infers the probability of each class of object appearing in the image to be inferred. Note that both DNN1 and DNN2 perform inference on the same image.
[0015] In the processing system, the edge device determines whether to adopt the inference result of DNN1 or DNN2 based on the result of comparing the confidence level with a threshold value. The confidence level is a value for determining whether the data to be processed should be processed in the edge device or the server device. The confidence level is the degree of likelihood that the result of the object recognition by DNN1 is correct. For example, the confidence level may be the probability of the class of the object appearing in the image output by DNN1, for example, the probability of the highest class.
[0016] In the processing system, if the obtained confidence is equal to or greater than a predetermined threshold, the inference result of DNN1 is adopted. In other words, the inference result of the lightweight model is output as the final estimation result of the model cascade. On the other hand, in the processing system, if the confidence is less than a predetermined threshold, the inference result obtained by inputting a feature map extracted from the same image to DNN2 is output as the final inference result.
[0017] In this way, the processing system selects whether the data to be processed should be processed in the edge device or the server device based on the degree of certainty, and processes the data to be processed.
[0018] In the processing system, when the inference process is executed by the DNN2, the edge device quantizes the feature map extracted by the DNN1 and outputs the quantized feature map to the server device. The types of data and tasks to be processed by sharing the processing between the edge device and the server device are diverse.
[0019] Therefore, in the processing system, in a cascade model in which processing is shared between an edge device and a server device, the quantization parameter is adaptively set in the preparation stage according to the target information and the accuracy required for the task. This allows the processing system to reduce the amount of data transmission while maintaining the required inference accuracy in the operation stage.
[0020] [Processing system] Next, a description will be given of the configuration of the processing system according to embodiment 1. Fig. 2 is a diagram illustrating an example of the configuration of the processing system according to embodiment 1.
[0021] The processing system 100 according to the first embodiment includes a server device 20, an edge device 30, and a setting device 40. The server device 20 and the edge device 30 are connected via a network N. The network N is, for example, the Internet. The server device 20 and the setting device 40, and the edge device 30 and the setting device 40 are connected via a network (not shown). The server device 20 is, for example, a server provided in a cloud environment. The edge device 30 is, for example, an IoT device and various terminal devices. The setting device 40 is, for example, a server provided in a cloud environment.
[0022] The server device 20, the edge device 30, and the setting device are each realized by a computer or the like including a ROM (Read Only Memory), a RAM (Random Access Memory), a CPU (Central Processing Unit), etc., which loads a predetermined program and executes the predetermined program with the CPU. Also, so-called accelerators such as a GPU, a VPU (Vision Processing Unit), a Field Programmable Gate Array (FPGA), an ASIC (Application Specific Integrated Circuit), and a dedicated AI (Artificial Intelligence) chip are also used. The server device 20, the edge device 30, and the setting device each have a NIC (Network Interface Card) or the like, and can communicate with other devices via electric communication lines such as a LAN (Local Area Network) or the Internet.
[0023] As shown in Fig. 2, the server device 20 has an inference unit 21 (second inference unit) that performs inference using DNN2, which is a trained high-precision model. The DNN2 includes information such as model parameters. The DNN2 performs inference using the feature map extracted by the DNN1 as input.
[0024] The inference unit 21 uses the DNN2 to execute inference processing on the input image based on the feature map of the input image output from the edge device 30. The inference unit 21 decodes the quantized feature map output from the edge device 30 and uses it as an input for the DNN2. The inference unit 21 acquires and outputs an inference result (e.g., the probability for each class of object appearing in the image) as an output of the DNN2. Note that, when the inference result is to be returned to the user during operation, the inference result obtained by the inference unit 21 may be transmitted to the edge device 30 and returned from the edge device 30 to the user.
[0025] Here, the server device 20 and the edge device 30 constitute a model cascade. Therefore, the inference unit 21 does not always perform inference. When it is determined that the server device 20 should execute the inference process, the inference unit 21 accepts an input of a quantized feature map and performs inference using DNN2.
[0026] The edge device 30 has an inference unit 31 (first inference unit) having a DNN1 which is a trained lightweight model, a judgment unit 32, and a quantization unit 33.
[0027] The inference unit 31 performs inference using DNN1, which is a trained lightweight model. The DNN1 includes information such as model parameters. The DNN1 has a feature extraction layer Bf1 that extracts features from an image and outputs a feature map, and a processing layer Bd1 that receives the feature map as input and obtains an inference result (e.g., the probability of each class of an object appearing in the image). The inference unit 31 uses the DNN1 to extract features of the input image as a feature map, and performs inference processing on the input image based on the extracted feature map.
[0028] The inference unit 31 inputs an image to be processed into the DNN 1 to obtain an inference result. The inference unit 31 uses the DNN 1 to extract features of the data to be processed, and executes inference processing on the data to be processed based on the extracted features. The inference unit 31 accepts input of the image to be processed, processes the image to be processed, and outputs an inference result (for example, the probability for each class of objects appearing in the image).
[0029] The determination unit 32 determines whether to adopt the inference result of the edge device 30 or the server device 20 by comparing the confidence level with a predetermined threshold value.
[0030] When the confidence level is equal to or higher than a predetermined threshold, the determination unit 32 outputs the inference result inferred by the inference unit 31. When the confidence level is lower than a predetermined threshold, the determination unit 32 quantizes a feature map that is the output of the feature extraction layer Bf1 of the edge-side DNN1, and then outputs the quantized feature map to the server device 20, and causes the DNN2 arranged in the server device 20 to execute the inference process.
[0031] In the operation stage, when the determination unit 32 determines that the server device 20 should execute the inference process, the quantization unit 33 quantizes the feature map extracted by the feature extraction layer Bf1 of the DNN1, and outputs the quantized feature map to the server device 20. The number of quantization bits used for quantization is set by the first setting unit 43 in the advance preparation stage. In addition, in the advance preparation stage, the quantization unit 33 quantizes the feature maps of the sampling data extracted by the feature extraction layer Bf1 of the inference unit 31 with different quantization bit numbers, and outputs each quantized feature map to the setting device 40.
[0032] The setting device 40 has an inference accuracy acquisition unit 41, a first information amount calculation unit 42, and a first setting unit 43. In a preparatory stage, the setting device 40 adaptively sets a quantization parameter in the quantization unit 33 according to the target information amount and the accuracy required for the task. The setting device 40 sets the number of quantization bits in the quantization unit 33.
[0033] In a preparatory stage, sampling data is input to the edge device 30. The feature extraction layer Bf1 of the DNN1 extracts a feature map of the sampling data. The quantization unit 33 quantizes the feature maps of the sampling data with different quantization bit numbers, and outputs the quantized maps to the setting device 40 and the server device 20. In the server device 20, the inference unit 21 performs inference for each of the feature maps of the sampling data quantized by the quantization unit 33 with different quantization bit numbers.
[0034] The inference accuracy acquisition unit 41 acquires the accuracy of each inference result estimated by the inference unit 21 based on each feature map of the sampling data quantized at a preparatory stage with different quantization bit numbers by the quantization unit 33. In the case of a classification task, for example, the inference accuracy can be the ratio (correct answer rate) of correctly classified data to the entire data.
[0035] The first information amount calculation unit 42 calculates the information amount of each feature map of the sampling data quantized by the quantization unit 33 with different quantization bit numbers in the advance preparation stage.
[0036] In the advance preparation stage, the first setting unit 43 sets the initial number of quantum bits in the quantization unit 33 based on each amount of information calculated by the first information amount calculation unit 42 and the accuracy of each inference result acquired by the inference accuracy acquisition unit 41. The first setting unit 43 sets the initial number of quantum bits in the quantization unit 33 based on each amount of information calculated by the first information amount calculation unit 42, the accuracy of each inference result acquired by the inference accuracy acquisition unit 41, a weighting parameter λ1 (described later) for the amount of information in communication between the edge device 30 and the server device 20, and a weighting parameter λ2 (described later) for the inference accuracy.
[0037] [Quantization bit rate setting] Next, a description will be given of the process of setting the initial number of quantum bits in the quantization unit 33. Fig. 3 is a diagram for explaining the process of setting the initial number of quantum bits.
[0038] In the preparation stage, domain data is sampled and annotated (Figure 3 (1)), and the sampled data is input to the feature extraction layer Bf1 of the DNN1 of the edge device 30 to generate a feature map of the sampled data (Figure 3 (2)).
[0039] Next, the quantization unit 33 quantizes the feature map of the sampling data using int2, int3, int4, int5, int6, int7, and int8 quantization ((3) in FIG. 3).
[0040] The first information amount calculation unit 42 calculates the information amount of the feature map corresponding to each number of quantization bits based on the formula (1) ((4) in FIG. 3).
[0041]
number
[0042] The first information amount calculation unit 42 calculates the average information amount of the feature map quantized using int2, int3, int4, int5, int6, int7, and int8 quantization for each number of quantization bits ((4) in FIG. 3). The average information amount refers to the average of the information amounts of the feature maps of all sample data quantized with each number of quantization bits.
[0043] Next, each feature map of the sampling data quantized by the quantization unit 33 with a different number of quantization bits is input to the DNN2 of the server device 20, and inference is performed for each feature map ((5) in FIG. 3). The inference accuracy acquisition unit 41 acquires the accuracy of the inference result (e.g., graph E1) for each feature map quantized with each number of quantization bits ((6) in FIG. 3).
[0044] Graph E1 shows the relationship between the offload rate and the overall accuracy. The threshold is linked to the offload rate, and the threshold is increased when the offload rate is decreased. In graph E1, when the offload rate is "0", all data is processed by the edge device 30, and when the offload rate is "1", all data is processed by the server device 20.
[0045] The first setting unit 43 sets the initial number of quantum bits in the quantization unit 33 based on each amount of information calculated by the first information amount calculation unit 42 and the accuracy of each inference result acquired by the inference accuracy acquisition unit 41 ((7) in FIG. 3). Specifically, the first setting unit 43 optimizes the initial number of quantization bits based on the degree of accuracy loss due to quantization at each number of quantization bits relative to the offload rate and the amount of information calculated by the first information amount calculation unit 42. For example, the first setting unit 43 sets the initial number of quantization bits using formula (2).
[0046]
number
[0047] In formula (2), λ1 and λ2 are hyperparameters set by the user. The value of λ1 is set according to the degree of importance placed on the amount of information in the communication between the edge device 30 and the server device 20. The value of λ2 is set according to the degree of importance placed on the accuracy of inference. λ1 and λ2 are set by the user according to the type of data and tasks shared between the edge device 30 and the server device 20 for processing.
[0048] In addition, among the information amounts and inference results of the feature maps quantized at each quantization bit, those for which the inference accuracy of the DNN2 based on the feature maps quantized at each quantization bit number is higher than the accuracy of the DNN1 of the edge device 30, or the inference accuracy of the DNN2 based on the feature maps quantized at each quantization bit number meets or exceeds the user's required accuracy, are subject to the calculation of formula (2).
[0049] In the example of Figure 3, the first setting unit 43 sets int5 quantization, i.e., sets "5" as the initial quantization bit count, based on the calculation result by the first information amount calculation unit 42 and the result of the inference accuracy corresponding to int5 quantization.
[0050] As shown in frame W1 of graph E1, when quantization is performed using int5 quantization, the decrease in inference accuracy is relatively small even if the offset rate increases, and the impact on inference accuracy is also small. Also, when the feature maps of all input images are quantized using int8 (each tensor value is expressed in 8 bits) and sent to the server, the amount of data transferred remains large. In contrast, by applying int5 quantization for quantization, the amount of data can be reduced by about 2.5 times compared to int8 quantization.
[0051] For example, in the case of a task of object recognition, the distance between the camera and the object (the size of the area occupied by the object in the image) is far or close, and the absolute size of the object is large or small, for example. In this example, it is considered that when the object is close to the camera (for example, 90% accuracy), normal accuracy is better than when the object is far away (for example, 50% accuracy). When the user's desired accuracy is, for example, 50%, a camera that is closer is more likely to be quantized with a lower bit number, so the first setting unit 43 quantizes by lowering the quantization bit number. In addition, in the case of a distant camera, further lowering the quantization bit number will result in the accuracy falling below 50%, so the first setting unit 43 does not lower the quantization bit number and keeps it at int8 quantization. In this way, the processing system 100 sets an optimal quantization bit number that matches the characteristics of the domain data while satisfying both the reduction of the amount of data transmitted from the edge device 30 to the server device 20 and the assurance of inference accuracy, as desired by the user or use case.
[0052] In addition, if it is possible to re-train DNN2 using the quantized feature map, it is expected that the overall accuracy can be restored, so the first setting unit 43 may set the quantization unit 33 to perform quantization using int2 quantization, int3 quantization, or int4 quantization (see box W2 in graph E1).
[0053] [Initial quantization bitrate setting process] Next, a description will be given of a process for setting the initial number of quantization bits in the quantizer 33. Fig. 4 is a sequence diagram showing a processing procedure for setting the initial number of quantization bits.
[0054] 4, in the advance preparation stage, sampling domain data is input to the inference unit 31 of the edge device 30 (step S1), and the inference unit 31 extracts features of the sampling data (step S2) and generates a feature map. The inference unit 31 outputs the feature map to the quantization unit 33 (step S3).
[0055] The quantization unit 33 quantizes the feature maps of the sampling data with different quantization bit numbers (step S4), and outputs each quantized feature map to the setting device 40 and the inference unit 21 of the server device 20 (steps S5 and S6). In the setting device 40, the first information amount calculation unit 42 performs a first information amount calculation process to calculate the information amount of each feature map of the sampling data quantized with different quantization bit numbers by the quantization unit 33 (step S7). The first information amount calculation unit 42 outputs the calculation result to the first setting unit 43 (step S8).
[0056] In the server device 20, the inference unit 21 performs inference for each feature map of the sampling data quantized by the quantization unit 33 with different quantization bit numbers (step S9), and outputs each inference result to the setting device 40 (step S10).
[0057] In the setting device 40, the inference accuracy acquisition unit 11 acquires the accuracy of each inference result estimated by the inference unit 21 based on each feature map of the sampling data quantized by the quantization unit 33 with different quantization bit numbers (step S11), and outputs the accuracy of each inference result to the first setting unit 43 (step S12).
[0058] The first setting unit 43 sets the initial number of quantum bits in the quantization unit 33 based on each amount of information calculated by the first information amount calculation unit 42 and the accuracy of each inference result acquired by the inference accuracy acquisition unit 41 (steps S13, S14).
[0059] [Inference processing procedure] Fig. 5 is a sequence diagram showing the processing procedure of the inference process according to the first embodiment. As shown in Fig. 5, during operation, when the inference unit 31 of the edge device 30 accepts an input of an image (step S21), the input image is input to the inference unit 31. The inference unit 31 extracts a feature amount of the input image as a feature map (step S22) and outputs it to the determination unit 32 (step S23). The inference unit 31 executes an inference process on the input image based on the feature map (step S24) and outputs it to the determination unit 32 (step S25).
[0060] The determination unit 32 calculates a confidence level based on the inference result by the inference unit 31 (step S26), compares the calculated confidence level with a predetermined threshold, and determines whether the confidence level is equal to or greater than the predetermined threshold (step S27).
[0061] If the confidence level is equal to or higher than the threshold (step S27: Yes), the determination unit 32 outputs the inference result inferred by the DNN1 of the inference unit 31 (step S28). On the other hand, if the confidence level is lower than the threshold (step S27: No), the determination unit 32 outputs the feature map to the quantization unit 33 (step S29). The quantization unit 33 quantizes the feature map with the initial quantization bit rate set by the first setting unit 43 (step S30), and transmits the feature map to the server device 20 (step S31).
[0062] In the server device 20, the inference unit 21 decodes the quantized feature map output from the edge device 30 and uses it as an input for the DNN2. In the inference unit 21, the DNN2 executes inference processing for the input image based on the feature map output from the edge device 30 (step S32). The server device 20 transmits the inference result of the DNN2 to the edge device 30 (step S33), and the result is output from the edge device 30 (step S34).
[0063] 5 assumes a configuration in which the inference result is returned to the user, and is configured to output the final inference result from the edge device 30, but when the final inference result is used on the server device 20 side, the inference result of DNN2 may be output from the server device 20 or may be stored as is in the server device 20. When the inference result of DNN1 is used, the edge device 30 may transmit the inference result to the server device 20 when the inference result is used on the server device 20 side.
[0064] [Advantages of the first embodiment] In this way, in the processing system 100, the number of quantization bits for quantization in the quantizer 33 is adaptively set in the advance preparation stage according to the amount of data to be transmitted from the edge device to the server device and the accuracy required for the task. As a result, in the processing system 100, when actually operated, the amount of data transmission can be reduced while maintaining the required inference accuracy. By applying this first embodiment, it is possible to realize automatic analysis of surveillance camera images, automatic driving, smart speakers, and the like that are capable of operating with high accuracy in real time.
[0065] 2, the setting device 40 is provided to set the number of quantization bits for the quantization unit 33, but the present invention is not limited to this. Figs. 6 and 7 are diagrams each showing a schematic diagram of another example of the configuration of the processing system according to the first embodiment.
[0066] As shown in a processing system 100A in Fig. 6, an inference accuracy acquisition unit 41 may be provided on the server device 20A side, and a first information amount calculation unit 42 and a first setting unit 43 may be provided on the edge device 30A to set the number of quantization bits for the quantization unit 33. Also, as shown in a processing system 100B in Fig. 7, the inference accuracy acquisition unit 41, the first information amount calculation unit 42, and the first setting unit 43 may be provided on the server device 20B.
[0067] [Embodiment 2] Next, a description will be given of embodiment 2. In embodiment 2, the number of quantization bits in the quantizer 33 is dynamically optimized during actual operation.
[0068] [Processing system] Next, a description will be given of the configuration of a processing system according to embodiment 2. Fig. 8 is a diagram illustrating an example of the configuration of a processing system according to embodiment 2.
[0069] As shown in Fig. 8, the processing system 200 according to the second embodiment has an edge device 230 instead of the edge device 30 shown in Fig. 2. Compared to the edge device 30, the edge device 230 further has a second information amount calculation unit 234 and a second setting unit 235.
[0070] In the operation stage, inference target data is input to the edge device 30. In the inference unit 31, a feature map of the inference target data is extracted in the feature extraction layer Bf1 of the DNN1. Here, in order to optimize the number of quantization bits, the quantization unit 33 quantizes the feature map of the inference target data with different numbers of quantization bits at a predetermined timing.
[0071] The second information amount calculation unit 234 calculates the information amount of each feature amount of the inference target data quantized by the quantization unit 33 with different quantization bit numbers.
[0072] The second setting unit 235 acquires the information amount quantized with the smallest number of quantization bits within a predetermined allowable information loss range from among the information amounts calculated by the second information amount calculation unit 234, and sets the number of quantization bits corresponding to the acquired information amount as the number of quantum bits in the quantization unit 33.
[0073] [Quantization bitrate optimization] Next, a description will be given of the process of optimizing the number of quantum bits of the quantization unit 33 in the operation stage. Fig. 9 is a diagram for explaining the process of optimizing the number of quantum bits in the operation stage.
[0074] First, in a preparation stage ((A) of FIG. 9), steps S1 to S14 shown in FIG. 4 are executed to set an initial number of quantum bits. For example, as illustrated in FIG. 3, int5 quantization is set as the quantization of the quantization unit 33.
[0075] Here, we calculate the maximum information loss, which is the difference between the information amount of the feature of the sampling data quantized with the maximum number of bits and the feature of the sampling data quantized with the initial number of quantum bits. In the example of Figure 4, the average information amount when the feature map of the sampling data is quantized with int8 quantization is  ̄H (8) (=6.0827) and the average information amount  ̄H when the feature map of the sampling data is quantized using int5 quantization with the initial quantization bit number "5" as a parameter. (5) The difference of 2.442 from (=3.6407) is the maximum amount of information loss (Figure 9 (1)).
[0076] Then, in the operation stage, the quantization unit 33 quantizes the feature map of the input image of the inference target with int2, int3, int4, int5, int6, int7, and int8 quantization at a predetermined timing. The second information amount calculation unit 234 calculates the information amount of each feature map of the input image of the inference target quantized by the quantization unit 33 with int2, int3, int4, int5, int6, int7, and int8 quantization for each input image of the inference target.
[0077] Next, the second setting unit 235 obtains, from among the amounts of information calculated by the second information amount calculation unit 234, the amount of information quantized with the smallest number of quantization bits within a predetermined allowable information loss range.
[0078] The allowable information loss range is a range between the amount of information obtained by subtracting the maximum amount of information loss from the amount of information of the feature of the input data of the inference target quantized with the maximum number of bits and the amount of information of the feature of the input data of the inference target quantized with the maximum number of bits. In the example of Fig. 9, the allowable information loss range is from the amount of information "1.5456" obtained by subtracting the maximum amount of information loss "2.442" from the amount of information "3.9876" of the feature of the input data of the inference target quantized with int8 quantization to the amount of information "3.9876" of the feature of the input data of the inference target quantized with int8 quantization ((2) in Fig. 9).
[0079] The second setting unit 235 acquires an information amount quantized with the smallest quantization bit rate within the allowable information loss range of "1.5456" to "3.9876" from among the information amounts calculated by the second information amount calculation unit 234. In the example of FIG. 9, the second setting unit 235 acquires an information amount "1.6016" corresponding to int4 quantization. Then, the second setting unit 235 sets the quantization bit rate "4" corresponding to the acquired information amount "1.6016" as the quantization bit rate in the quantization unit 33 ((3) in FIG. 9). In the subsequent processing, the quantization unit 33 quantizes the feature map with int4 quantization.
[0080] [Quantization bit rate setting process during operation] FIG. 10 is a flowchart showing a procedure for setting the quantization bitrate in the operation stage.
[0081] In the operation stage, when inference target data is input to the edge device 30, the inference unit 31 extracts a feature map of the inference target data (step S201). The quantization unit 33 quantizes the feature map of the inference target data with different quantization bit numbers at a predetermined timing (step S202).
[0082] The second information amount calculation unit 234 performs a second information amount calculation process to calculate the information amount of each feature map of the inference target data quantized by the quantization unit 33 with different quantization bit numbers (step S203).
[0083] The second setting unit 235 acquires the information amount quantized with the smallest number of quantization bits within a predetermined tolerable information loss range from among the information amounts calculated by the second information amount calculation unit 234, and sets the number of quantization bits corresponding to the acquired information amount as the number of quantum bits in the quantization unit 33 (step S204).
[0084] [Effects of the second embodiment] In this way, in the processing system 200 according to the second embodiment, the edge device 230 dynamically optimizes the number of quantization bits based on the amount of information of each feature map in real time during the inference stage. For example, the edge device 230 can compress an input image with a small amount of information with a smaller number of bits. In addition, the edge device 230 transmits an input image with a large amount of information to the server device 20 without reducing the amount of information, so that the accuracy of inference in the server device 20 can be maintained.
[0085] In the first and second embodiments, an image is used as an example of data to be processed, but the data is not limited to an image and may be detection results obtained by various sensors. In the first and second embodiments, the number of edge devices 30 or server devices 20 may be multiple, or both the number of edge devices 30 and server devices 20 may be multiple.
[0086] [System configuration, etc.] Each component of each device shown in the figure is a functional concept, and does not necessarily have to be physically configured as shown in the figure. In other words, the specific form of distribution and integration of each device is not limited to that shown in the figure, and all or a part of it can be functionally or physically distributed and integrated in any unit according to various loads, usage conditions, etc. Furthermore, each processing function performed by each device can be realized in whole or in any part by a CPU and a program analyzed and executed by the CPU, or can be realized as hardware using wired logic.
[0087] Furthermore, among the processes described in this embodiment, all or part of the processes described as being performed automatically can be performed manually, or all or part of the processes described as being performed manually can be performed automatically by a known method. In addition, the information including the processing procedures, control procedures, specific names, various data and parameters shown in the above documents and drawings can be changed arbitrarily unless otherwise specified.
[0088] [program] 11 is a diagram showing an example of a computer in which an edge device 30, a server device 20, and a setting device 40 are realized by executing a program. The computer 1000 has, for example, a memory 1010 and a CPU 1020. The computer 1000 may also have the accelerator described above to assist in calculations. The computer 1000 also has a hard disk drive interface 1030, a disk drive interface 1040, a serial port interface 1050, a video adapter 1060, and a network interface 1070. These components are connected by a bus 1080.
[0089] The memory 1010 includes a ROM (Read Only Memory) 1011 and a RAM 1012. The ROM 1011 stores a boot program such as a BIOS (Basic Input Output System). The hard disk drive interface 1030 is connected to a hard disk drive 1090. The disk drive interface 1040 is connected to a disk drive 1100. A removable storage medium such as a magnetic disk or an optical disk is inserted into the disk drive 1100. The serial port interface 1050 is connected to a mouse 1110 and a keyboard 1120, for example. The video adapter 1060 is connected to a display 1130, for example.
[0090] The hard disk drive 1090 stores, for example, an OS (Operating System) 1091, an application program 1092, a program module 1093, and program data 1094. That is, the programs that define the processes of the edge device 30, the server device 20, and the setting device 40 are implemented as program modules 1093 in which computer-executable codes are written. The program modules 1093 are stored, for example, in the hard disk drive 1090. For example, the program modules 1093 for executing processes similar to those of the functional configurations in the edge device 30, the server device 20, and the setting device 40 are stored in the hard disk drive 1090. The hard disk drive 1090 may be replaced by an SSD (Solid State Drive).
[0091] Furthermore, setting data used in the processing of the above-described embodiment is stored as program data 1094, for example, in the memory 1010 or the hard disk drive 1090. Then, the CPU 1020 reads out the program module 1093 or the program data 1094 stored in the memory 1010 or the hard disk drive 1090 into the RAM 1012 as necessary, and executes them.
[0092] Note that the program module 1093 and the program data 1094 are not limited to being stored in the hard disk drive 1090, but may be stored in, for example, a removable storage medium and read by the CPU 1020 via the disk drive 1100 or the like. Alternatively, the program module 1093 and the program data 1094 may be stored in another computer connected via a network (such as a local area network (LAN) or wide area network (WAN)). The program module 1093 and the program data 1094 may then be read by the CPU 1020 from the other computer via the network interface 1070.
[0093] Although the embodiments of the present invention have been described above, the present invention is not limited by the descriptions and drawings that form part of the disclosure of the present invention according to the present embodiments. In other words, other embodiments, examples, and operation techniques made by those skilled in the art based on the present embodiments are all included in the scope of the present invention. [Explanation of symbols]
[0094] 20, 20A, 20B Server device 21,31 Reasoning part 30,30A,230 Edge Device 32 Judgment section 33 Quantization section 40 Setting device 41 Inference accuracy acquisition unit 42 1st information calculation section 43 First Setting Section 100, 100A, 100B, 200 Processing System 234 2nd information calculation section 235 Second Setting Section
Claims
1. A processing system using an edge device and a server device, The edge device includes: a first inference unit that extracts a feature amount of data using a first model and executes an inference process on the data based on the extracted feature amount; a determination unit that determines whether to output the inference result by the first inference unit when a degree of certainty for the inference result by the first inference unit is equal to or greater than a threshold, and whether to output the feature amount of the data to the server device when the degree of certainty is less than the threshold; a quantization unit that quantizes the feature amount of the data extracted by the first inference unit and outputs the quantized feature amount; having The server device includes: a second inference unit that executes an inference process on the data output from the edge device based on a feature amount of the data by using a second model having a higher inference accuracy than the first model; having The processing system includes: an inference accuracy acquisition unit that acquires accuracy of each inference result estimated by the second inference unit based on each feature amount of the sampling data quantized by the quantization unit with different quantization bit numbers; a first information amount calculation unit that calculates an information amount of each feature amount of the sampling data quantized by the quantization unit with different quantization bit numbers; A first setting unit that sets an initial number of quantum bits in the quantization unit based on each amount of information calculated by the first information amount calculation unit and the accuracy of each inference result acquired by the inference accuracy acquisition unit; A processing system comprising:
2. The processing system according to claim 1, characterized in that the first setting unit sets an initial number of quantum bits in the quantization unit based on each amount of information calculated by the first information amount calculation unit, the accuracy of each inference result acquired by the inference accuracy acquisition unit, a weighting parameter for the amount of data in communication between the edge device and the server device, and a weighting parameter for the inference accuracy.
3. The edge device includes: a second information amount calculation unit that calculates an information amount of each feature amount of the inference target data quantized by the quantization unit with different quantization bit numbers; A second setting unit that acquires an information amount quantized with the smallest quantization bit number within a predetermined allowable information loss range from each information amount calculated by the second information amount calculation unit, and sets the quantization bit number corresponding to the acquired information amount as the number of quantum bits in the quantization unit; 3. The processing system according to claim 1, further comprising:
4. The processing system described in claim 3, characterized in that the tolerable information loss range is a range from the amount of information obtained by subtracting the maximum amount of information loss, which is the difference between the amount of information of the feature of the sampling data quantized with the maximum number of bits and the feature of the sampling data quantized with the initial number of quantum bits, from the amount of information of the feature of the inference target data quantized with the maximum number of bits to the amount of information of the feature of the inference target data quantized with the maximum number of bits.
5. A processing method executed by a processing system using an edge device and a server device, comprising: a first inference step in which the edge device extracts a feature amount of data using a first model and executes an inference process on the data based on the extracted feature amount; a determination step in which the edge device determines whether to output the inference result in the first inference step when a degree of certainty for the inference result in the first inference step is equal to or greater than a threshold, and whether to output the feature amount of the data to the server device when the degree of certainty is less than the threshold; a quantization step in which the edge device quantizes and outputs the feature amount of the data extracted in the first inference step; a second inference process in which the server device executes an inference process on the data based on the feature amount of the data output from the edge device by using a second model having higher inference accuracy than the first model; an inference accuracy acquisition step in which the processing system acquires accuracy of each inference result estimated in the second inference step based on each feature amount of the sampling data quantized with different quantization bit numbers in the quantization step; a first information amount calculation step in which the processing system calculates an information amount of each feature amount of the sampling data quantized with different quantization bit numbers in the quantization step; a first setting step in which the processing system sets an initial number of quantum bits in the quantization step based on each amount of information calculated in the first information amount calculation step and the accuracy of each inference result acquired in the inference accuracy acquisition step; A processing method comprising the steps of:
6. A processing program for causing a computer to execute the method, Computers as edge devices a first inference step of extracting a feature amount of data using a first model and executing an inference process on the data based on the extracted feature amount; a determination step of determining whether to output the inference result obtained by the first inference step when a degree of certainty for the inference result obtained by the first inference step is equal to or greater than a threshold, and whether to output the feature amount of the data to a server device when the degree of certainty is less than the threshold; a quantization step of quantizing and outputting the feature amount of the data extracted in the first inference step; Run the command, The computer as the server device includes: a second inference step of executing an inference process on the data based on the feature amount of the data output from the edge device by using a second model having a higher inference accuracy than the first model; Run the command, A computer as a device constituting a processing system, an inference accuracy acquisition step of acquiring accuracy of each inference result estimated in the second inference step based on each feature amount of the sampling data quantized with different quantization bit numbers in the quantization step; a first information amount calculation step of calculating an information amount of each feature amount of the sampling data quantized with different quantization bit numbers in the quantization step; a first setting step of setting an initial number of quantum bits in the quantization step based on each amount of information calculated in the first information amount calculation step and the accuracy of each inference result acquired in the inference accuracy acquisition step; A processing program characterized by executing the above.
Citation Information
Patent Citations
Federated learning method and system based on batch size and gradient compression ratio adjustment
CN111401552A
Wireless federation learning method based on compressed sensing and quantization coding
CN111901829A
Arithmetic processing device, information processing device and arithmetic processing method
JP2020135549A
Apparatus and method of compressing neural network
US20200184333A1
Video analysis method, video analysis system, and information processing device
WO2021070215A1
