Method and system for deploying large security supervision model in edge device
By deploying a lightweight safety supervision model after cropping and adjusting in edge devices, the problems of low adaptability and long deployment time in the existing technology of safety supervision models are solved, and the effects of rapid deployment and low performance requirements are achieved.
Patent Information
- Application Number
- CN202410917370.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2024-11-01
AI Technical Summary
When deployed in edge devices, the existing high-performance safety supervision model is not very adaptable, has a long loading time, and has high requirements for edge devices performance.
By learning weight cutting and equivalent transformation techniques, the original safety supervision model is cut and activated value adjustment, and a lightweight safety supervision model is obtained and deployed to edge devices.
It improves the adaptability and deployment speed of safety supervision models in edge devices, and reduces the performance requirements for edge devices.
Smart Images

Figure CN118886484A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer technology, and in particular relates to a method and system for deploying a large safety supervision model in an edge device. Background Art
[0002] The safety supervision model plays a very important role in the operation of the distribution network. When deployed in the edge device, it can connect to the control ball in the distribution network operation and realize edge side perspective control, thereby realizing automatic patrol of the horizontal and vertical working surfaces of the control ball, vertex training of the operating personnel, image and personnel recognition of the climbing carrier, and automatic tracking control.
[0003] However, existing high-performance safety monitoring models are large in size and memory consumption. When deployed on edge devices, they take a long time to load, have low adaptability, and have high performance requirements for edge devices.
[0004] Therefore, how to improve the adaptability of the large safety supervision model and enable the large safety supervision model to be quickly deployed in edge devices is a technical problem to be solved by technical personnel in this field. Summary of the invention
[0005] The purpose of the present invention is to solve the technical problems in the prior art that the large safety supervision model has low adaptability, long deployment time, and high performance requirements for edge devices.
[0006] To achieve the above technical objectives, on the one hand, the present invention provides a method for deploying a large safety supervision model in an edge device, the method comprising:
[0007] The first model is obtained by pruning the original large safety supervision model through learnable weight pruning;
[0008] The activation value in the first model is adjusted by equivalent transformation to obtain a lightweight safety supervision model;
[0009] The lightweight safety supervision model is deployed to the edge device.
[0010] Furthermore, the first model is obtained by pruning the original safety supervision large model through learnable weight pruning, which specifically includes:
[0011] The weights in the original safety supervision large model are trimmed by the learnable weight trimming;
[0012] The learnable weight clipping includes two learnable parameters, and the learnable parameters are optimized by the gradient descent method.
[0013] Furthermore, the equivalent transformation includes scaling parameters and shift parameters in the learning channel.
[0014] Furthermore, the method also includes optimizing parameters in learnable weight clipping and equivalent transformation through a block error minimization strategy.
[0015] Furthermore, the optimization can learn the parameters in weight clipping and equivalent transformation, specifically including:
[0016] The learnable weight clipping and equivalent transformation are divided into blocks respectively;
[0017] Parameter optimization is performed block by block.
[0018] Furthermore, before the original large safety supervision model is pruned by learnable weight pruning to obtain the first model, the method also includes training learnable weight pruning and equivalent transformation.
[0019] On the other hand, the present invention also provides a system for deploying a large safety monitoring model in an edge device, the system comprising:
[0020] A trimming module, used for trimming the original safety supervision large model by learnable weight trimming to obtain a first model;
[0021] An equivalent transformation module, used for adjusting the activation value in the first model to obtain a lightweight safety supervision model;
[0022] A deployment module is used to deploy the lightweight safety supervision model to the edge device.
[0023] The present invention provides a method and system for deploying a large safety supervision model in an edge device. Compared with the prior art, the method first obtains a first model by clipping the original large safety supervision model through learnable weight clipping; then adjusts the activation value in the first model through equivalent transformation to obtain a lightweight safety supervision model; finally, the lightweight safety supervision model is deployed to the edge device, which can improve the adaptability of the large safety supervision model, and at the same time enable the large safety supervision model to be quickly deployed in the edge device, thereby reducing the performance requirements for the edge device. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0025] Figure 1 The figure is a flow chart of a method for deploying a large safety monitoring model in an edge device provided in an embodiment of this specification;
[0026] Figure 2 Shown is a schematic diagram of the structure of a system for deploying a large security monitoring model in an edge device provided in an embodiment of this specification. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0028] like Figure 1 The flowchart of the method for deploying a large model of safety supervision in an edge device provided by the embodiment of this specification is shown. Although this specification provides the method operation steps or system structure shown in the following embodiments or drawings, the method or system may include more or fewer operation steps or module units after partial merger based on routine or no creative labor. In the steps or structures where there is no necessary causal relationship logically, the execution order of these steps or the module structure of the system is not limited to the execution order or module structure shown in the embodiments or drawings of this specification. When the method or module structure is applied in the actual system, server or terminal product, it can be executed sequentially or in parallel according to the method or module structure shown in the embodiment or drawings (for example, a parallel processor or multi-threaded processing environment, or even a distributed processing, server cluster implementation environment).
[0029] The method for deploying a large security monitoring model in an edge device provided in the present embodiment can be applied to terminal devices such as clients and servers and edge devices, such as Figure 1 As shown, the method specifically comprises the following steps:
[0030] Step S101, pruning the original large safety supervision model through learnable weight pruning to obtain a first model.
[0031] Specifically, learnable weight clipping (LWC) is a key step in the quantization process. The first model is obtained by clipping the original safety supervision model through learnable weight clipping, which specifically includes:
[0032] The weights in the original safety supervision large model are trimmed by the learnable weight trimming;
[0033] The learnable weight clipping includes two learnable parameters, and the learnable parameters are optimized by the gradient descent method.
[0034] It reduces the number of bits required by limiting the range of weight values. Instead of using a fixed clipping threshold, LWC in this scheme introduces two learnable parameters γ (upper bound) and β (lower bound) to dynamically adjust the clipping range of weights. By optimizing these parameters by the gradient descent method, LWC can adaptively determine the optimal clipping threshold for each weight, thereby achieving effective quantization without sacrificing too much accuracy.
[0035] Step S102: adjusting the activation value in the first model through equivalent transformation to obtain a lightweight safety supervision model.
[0036] Specifically, the purpose of the Learnable Equivalent Transformation (LET) is to adjust the distribution of activation values to a form that is more suitable for quantization. LET achieves this goal by learning channel-level scaling parameters and shifting parameters, which can be dynamically adjusted during the quantization process, making the distribution of activation values that were originally difficult to quantize smoother and reducing quantization errors.
[0037] In an embodiment of the present application, before the original large safety supervision model is pruned by learnable weight pruning to obtain the first model, the method further includes training the learnable weight pruning and equivalent transformation.
[0038] The method also includes optimizing parameters in learnable weight clipping and equivalent transformation through a block error minimization strategy.
[0039] The optimization can learn parameters in weight clipping and equivalent transformation, including:
[0040] The learnable weight clipping and equivalent transformation are divided into blocks respectively;
[0041] Parameter optimization is performed block by block.
[0042] Specifically, in order to effectively optimize the LWC and LET parameters, this patent adopts a block error minimization strategy. This method divides the model into multiple blocks (for example, each Transformer layer), and then optimizes the quantization parameters block by block. By minimizing the difference between the model output before and after quantization, the algorithm can effectively learn weight clipping and equivalent transformation parameters that adapt to quantization.
[0043] Step S103: deploy the lightweight safety supervision model to the edge device.
[0044] Specifically, the security supervision model after the above processing is finally deployed in the edge device, which can improve the adaptability and running speed of the security supervision model in the edge device, and at the same time enable the security supervision model to be quickly deployed in the edge device, reducing the performance requirements for the edge device.
[0045] Based on the above-mentioned method of deploying a large model of safety supervision in edge devices, one or more embodiments of this specification also provide a platform and terminal for deploying a large model of safety supervision in edge devices. The platform or terminal may include a system, software, module, plug-in, server, client, etc. using the method described in the embodiments of this specification and combined with the necessary implementation hardware. Based on the same innovative concept, the system in one or more embodiments provided in the embodiments of this specification is as described in the following embodiments. Since the implementation scheme and method for solving the problem by the system are similar, the implementation of the specific system in the embodiments of this specification can refer to the implementation of the aforementioned method, and the repetitions will not be repeated. The terms "unit" or "module" used below can be a combination of software and / or hardware that implements predetermined functions. Although the system described in the following embodiments is preferably implemented in software, hardware and a combination of software and hardware are also possible and conceived.
[0046] Specifically, Figure 2 This is a schematic diagram of the module structure of an embodiment of a system for deploying a large safety monitoring model in an edge device provided in this specification, such as Figure 2 As shown, the system for deploying a large safety supervision model in an edge device provided in this specification includes:
[0047] A clipping module 201, used for clipping the original safety supervision large model through learnable weight clipping to obtain a first model;
[0048] An equivalent transformation module 202, used for adjusting the activation value in the first model to obtain a lightweight safety supervision model;
[0049] The deployment module 203 is used to deploy the lightweight safety supervision model to the edge device.
[0050] It should be noted that the above-mentioned system may also include other implementation modes according to the description of the corresponding method embodiment. The specific implementation modes may refer to the description of the above-mentioned corresponding method embodiment, which will not be described one by one here.
[0051] The present application also provides an electronic device, including:
[0052] processor;
[0053] a memory for storing instructions executable by the processor;
[0054] The processor is configured to execute the method provided in the above embodiment.
[0055] The electronic device provided in the embodiment of the present application stores the executable instructions of the processor through a memory. When the processor executes the executable instructions, it can firstly clip the original large safety supervision model through learnable weight clipping to obtain a first model; then adjust the activation value in the first model through an equivalent transformation to obtain a lightweight safety supervision model; finally, deploy the lightweight safety supervision model to the edge device, so as to improve the adaptability of the safety supervision model and enable the safety supervision model to be quickly deployed in the edge device, thereby reducing the performance requirements for the edge device.
[0056] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0057] The methods or systems described in the above embodiments provided in this specification can implement business logic through computer programs and record them on storage media, and the storage media can be read and executed by computers to achieve the effects of the solutions described in the embodiments of this specification, such as:
[0058] The first model is obtained by pruning the original large safety supervision model through learnable weight pruning;
[0059] The activation value in the first model is adjusted by equivalent transformation to obtain a lightweight safety supervision model;
[0060] The lightweight safety supervision model is deployed to the edge device.
[0061] The storage medium may include a physical system for storing information, which is usually a medium that digitizes information and then stores it in an electrical, magnetic or optical manner. The storage medium may include: a system that stores information in an electrical energy manner, such as various memories, such as RAM, ROM, etc.; a system that stores information in a magnetic energy manner, such as a hard disk, a floppy disk, a magnetic tape, a magnetic core memory, a magnetic bubble memory, a USB flash drive; a system that stores information in an optical manner, such as a CD or a DVD. Of course, there are other readable storage media, such as quantum memory, graphene memory, etc.
[0062] The embodiments of this specification are not limited to complying with industry communication standards, standard computer resource data update and data storage rules, or the situations described in one or more embodiments of this specification. Certain industry standards or slightly modified implementation plans based on the implementation described in the custom method or embodiment can also achieve the same, equivalent or similar, or predictable implementation effects after deformation of the above-mentioned embodiments. The embodiments obtained by using these modified or deformed data acquisition, storage, judgment, processing methods, etc. can still fall within the scope of the optional implementation plans of the embodiments of this specification.
[0063] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, ATMEL AT91SAM, MICROCHIP PIC18F26K20, and SILICONE LABS C8051F320. The memory controller can also be implemented as part of the control logic of the memory. It is also known to those skilled in the art that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the system for implementing various functions included therein can also be regarded as a structure within the hardware component. Or even, the system for implementing various functions can be regarded as both a software module for implementing the method and a structure within the hardware component.
[0064] The system embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. There may be other divisions in actual implementation, such as multiple units or plug-ins may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be through some interface, indirect coupling or communication connection of the system or unit, which may be electrical, mechanical or other forms.
[0065] These computer program instructions may also be loaded onto a computer or other programmable resource data updating device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions executed on the computer or other programmable device for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0066] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. In the description of this specification, the description of the reference terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of this specification. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples without contradiction.
[0067] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.
Claims
1. A method for deploying a large safety monitoring model in edge devices, It is characterized in that The method comprises: The first model is obtained by pruning the original large safety supervision model through learnable weight pruning; The activation value in the first model is adjusted by equivalent transformation to obtain a lightweight safety supervision model; The lightweight safety supervision model is deployed to the edge device.
2. The method for deploying a large safety monitoring model in an edge device as claimed in claim 1, It is characterized in that The first model is obtained by clipping the original safety supervision model through learnable weight clipping, which specifically includes: The weights in the original safety supervision large model are trimmed by the learnable weight trimming; The learnable weight clipping includes two learnable parameters, and the learnable parameters are optimized by the gradient descent method.
3. The method for deploying a large safety monitoring model in an edge device as claimed in claim 1, It is characterized in that The equivalent transformation includes scaling parameters and shift parameters in the learning channel.
4. The method for deploying a large safety monitoring model in an edge device as claimed in claim 1, It is characterized in that The method also includes optimizing parameters in learnable weight clipping and equivalent transformation through a block error minimization strategy.
5. The method for deploying a large safety monitoring model in an edge device as claimed in claim 4, It is characterized in that The optimization can learn parameters in weight clipping and equivalent transformation, including: The learnable weight clipping and equivalent transformation are divided into blocks respectively; Parameter optimization is performed block by block.
6. The method for deploying a large safety monitoring model in an edge device as claimed in claim 1, It is characterized in that Before the original large safety supervision model is pruned by learnable weight pruning to obtain the first model, the method further includes training the learnable weight pruning and equivalent transformation.
7. A system for deploying a large safety monitoring model in edge devices, It is characterized in that The system comprises: A trimming module, used for trimming the original safety supervision large model by learnable weight trimming to obtain a first model; An equivalent transformation module, used for adjusting the activation value in the first model to obtain a lightweight safety supervision model; A deployment module is used to deploy the lightweight safety supervision model to the edge device.
