Adaptive retail behavior recognition model optimization method for edge computing
By constructing an adaptive retail behavior recognition model optimization method in an edge computing environment, using L2 norms and inter-layer connection density evaluation indicators for adaptive pruning and quantification, combined with real-time data updates, the shortcomings of retail behavior recognition system in model optimization and dynamic adaptability are solved, and the recognition accuracy and efficiency are improved.
Patent Information
- Application Number
- CN202411876379.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2044-12-19
AI Technical Summary
The existing retail behavior recognition system has insufficient model optimization in edge computing, which makes it difficult to achieve a good balance between model size and recognition accuracy, lacks adaptive adjustment capabilities, and is unable to effectively deal with dynamic changes in retail scenarios. The incremental learning and online update mechanism are simple, which affects the continuous optimization effect of the system.
By building an intelligent model optimization and online update framework, the importance score of neuron weights is calculated using the L2 norm, multi-dimensional evaluation indicators are generated based on the inter-layer connection density, adaptive pruning and quantization are carried out, quantization perception layer is constructed, real-time data is collected for selective online updates, and model structure is optimized by combining asynchronous parameter aggregation and incremental learning.
It improves the operation efficiency and identification accuracy on edge devices, can respond to changes in retail scenarios in a timely manner, continuously optimize identification performance, adapt to the complexity of different tasks, and reduce computing and storage overhead.
Smart Images

Figure CN119358626B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and specifically to an adaptive retail behavior recognition model optimization method for edge computing. Background Art
[0002] With the rapid development of smart retail, edge computing is increasingly used in retail scenarios. Traditional retail behavior recognition methods mainly rely on cloud servers for processing, facing problems such as network latency and data transmission costs. Directly deploying complex deep learning models on resource-constrained edge devices will encounter bottlenecks in computing efficiency and memory usage.
[0003] The current mainstream retail behavior recognition systems have obvious deficiencies in model optimization. Common model compression methods often adopt unified pruning standards and fixed quantization strategies, lacking the ability to differentiate the importance of different levels. This simple compression method can easily cause a significant decline in model performance, and it is difficult to achieve a good balance between model size and recognition accuracy. At the same time, existing systems perform poorly in handling real-time data updates and model adaptability, and cannot effectively cope with dynamic changes in retail scenarios.
[0004] In terms of edge deployment and optimization, existing technologies still have a lot of room for improvement. The model optimization process lacks a scientific evaluation mechanism and adaptive adjustment capabilities, making it difficult to dynamically adjust the model structure according to actual application scenarios. In addition, the incremental learning and online update mechanisms are relatively simple, which affects the continuous optimization effect of the system. These problems seriously restrict the application effect of edge computing in retail behavior recognition. Summary of the invention
[0005] In response to the problems in the prior art, the present application provides an adaptive retail behavior recognition model optimization method for edge computing, which can improve the operating efficiency and recognition accuracy of the system on edge devices by building an intelligent model optimization and online update framework.
[0006] In order to solve at least one of the above problems, the present application provides the following technical solutions:
[0007] In a first aspect, the present application provides an adaptive retail behavior recognition model optimization method for edge computing, comprising:
[0008] A weight evaluation matrix is constructed based on an initial retail behavior recognition model, wherein the initial retail behavior recognition model includes three types of behavior recognition tasks, namely, commodity interaction, checkout operation, and customer movement line. The importance score of each layer of neuron weights is calculated using the L2 norm, and a multi-dimensional evaluation index is generated by combining the importance score with the inter-layer connection density. An adaptive pruning threshold is set according to the evaluation index, and structured pruning is performed layer by layer in a recursive manner. Parameter reconstruction and gradient compensation are performed on the pruned model to obtain a lightweight model.
[0009] During the training process of the lightweight model, a quantization perception layer is constructed, and the numerical distribution of the model parameters and intermediate activation values of the quantization perception layer are mapped to the optimal quantization interval. The gradient sensitivity is obtained by calculating the gradient change rate of each layer output to the weight perturbation, and the Shannon entropy is calculated based on the pixel distribution probability of the layer output feature map to obtain the feature information entropy. The performance index change rate is calculated using verification samples in different retail scenarios to establish an adaptive weight function. The verification samples include self-service checkout, shelf merchandise pickup, and customer stay behavior. The weight ratio of the gradient sensitivity to the feature information entropy is calculated according to the adaptive weight function, and the weight ratio is applied to the layer importance score calculation. The key layer is determined according to the layer importance score and the 16-bit floating point precision is maintained. 8-bit fixed-point quantization is performed on the non-key layer, and noise perturbation and compensation mechanisms are introduced to optimize the quantization error, so as to generate a quantization model adapted to the edge device.
[0010] Real-time retail scene data is collected on edge devices, and the temporal features of product operations, customer movement trajectories, and shopping behaviors are extracted to build a sample cache pool. The feature importance is calculated based on the sample cache pool, and the quantitative model is selectively updated online. Continuous model optimization is achieved by combining asynchronous parameter aggregation with incremental learning.
[0011] Furthermore, the weight evaluation matrix is constructed based on the initial retail behavior recognition model, and the initial retail behavior recognition model includes three types of behavior recognition tasks: commodity interaction, checkout operation and customer movement, including:
[0012] Quantize and map the weight parameters of each convolution kernel and the fully connected layer in the initial retail behavior recognition model, reconstruct the weight parameters into an M×N dimensional evaluation matrix using a sparse matrix representation method, where M represents the number of input feature channels and N represents the number of output feature channels, and the numerical values and topological connection relationships of the weight parameters are recorded in the evaluation matrix;
[0013] The input retail scene image data is used to extract the underlying features through a shared backbone network. Three parallel branch networks are set after the shared backbone network. The parallel branch networks respectively include convolution modules and fully connected modules for product interaction, settlement operations and customer movement line recognition. The features between the parallel branch networks are adaptively fused based on task relevance.
[0014] Furthermore, the importance score of each layer of neuron weights is calculated using the L2 norm, and a multi-dimensional evaluation index is generated by combining the importance score with the inter-layer connection density. An adaptive pruning threshold is set according to the evaluation index, and structured pruning is performed layer by layer in a recursive manner. Parameter reconstruction and gradient compensation are performed on the pruned model to obtain a lightweight model, including:
[0015] The weight vector of each layer of neurons is expressed as W={w1,w2,...,wn}, the L2 norm value of the weight vector ||W||2 is calculated as the basic score, the local sensitivity is calculated by applying a sliding window to the weight vector, the importance score of the neuron weight is obtained based on the product of the basic score and the local sensitivity, and the importance score is multiplied by the input and output connection density of the layer to obtain a multi-dimensional evaluation index;
[0016] Based on the multi-dimensional evaluation index, the expected compression rate of each layer is calculated, and the weighted sum of the expected compression rate and the preset benchmark threshold is used as the adaptive pruning threshold. The network structure is recursively traversed from the input layer to the output layer, and the neuron connections with weight importance scores lower than the adaptive pruning threshold are removed. The weights of the remaining neurons are reparameterized, and the distribution of model parameters after pruning is optimized by introducing a gradient compensation term.
[0017] Furthermore, in the training process of the lightweight model, a quantization perception layer is constructed, model parameters of the quantization perception layer and numerical distribution of intermediate activation values are mapped to an optimal quantization interval, and the gradient sensitivity is obtained by calculating the gradient change rate of each layer output to the weight perturbation, including:
[0018] Inserting a quantization operation unit into each layer of the network structure of the lightweight model, the quantization operation unit includes a floating-point number mapping module and a calibration factor calculation module, the floating-point number mapping module performs a linear transformation on the input value to normalize the value range to the interval [-1, 1], and the calibration factor calculation module adaptively adjusts the quantization accuracy based on the variance and kurtosis of the value distribution;
[0019] During the training process, Gaussian noise perturbation is applied to the weight parameters of the quantized perception layer, and the difference in layer output features before and after the perturbation is recorded. The partial derivative of the feature difference with respect to the weight perturbation is calculated based on back propagation, and the root mean square value of the partial derivative is used as the gradient sensitivity of the layer. The gradient sensitivity is normalized to obtain a standardized score.
[0020] Furthermore, the pixel distribution probability based on the layer output feature map is used to calculate the Shannon entropy to obtain the feature information entropy, and the performance index change rate is calculated using verification samples in different retail scenarios to establish an adaptive weight function. The verification samples include self-service checkout, shelf merchandise pickup, and customer stay behavior, including:
[0021] Perform pixel value statistics on the feature map output by the quantized perception layer, discretize the pixel value distribution into K equally spaced intervals, count the number of pixels in each interval and normalize them to obtain a probability distribution vector P={p1,p2,...,pk}, and calculate the Shannon entropy H=-∑pi based on the probability distribution vector log(pi) is used as the characteristic information entropy, and the characteristic information entropy is smoothed in time series using the exponential moving average method;
[0022] A verification sample set is constructed, which includes the payment operation sequence in the self-service checkout scenario, the commodity picking action sequence in the shelf area, and the behavior sequence in the customer residence area. Model reasoning is performed on the verification sample set to obtain the recognition accuracy of various tasks, and the influence of the change of quantitative parameters on the recognition accuracy is calculated. Based on the influence, an increasing weight mapping function is constructed.
[0023] Further, the weight ratio of the gradient sensitivity to the feature information entropy is calculated according to the adaptive weight function, the weight ratio is applied to the layer importance score calculation, the key layer is determined according to the layer importance score and the 16-bit floating point precision is maintained, the non-key layer is quantized with 8-bit fixed point, the noise disturbance and compensation mechanism is introduced to optimize the quantization error, and a quantization model adapted to the edge device is generated, including:
[0024] The weight coefficient output by the adaptive weight function is multiplied by the gradient sensitivity and feature information entropy of the corresponding layer respectively, and the weight ratio α of the gradient sensitivity and the weight ratio β of the feature information entropy are dynamically adjusted based on the task difficulty coefficient so that α+β=1, and the layer importance score is obtained by adding α times the normalized gradient sensitivity and β times the normalized feature information entropy, and the layer importance scores are sorted and screened;
[0025] The network layers whose layer importance scores are higher than the dynamic threshold are determined as key layers and the 16-bit floating point precision is maintained. The parameters of the non-key layers are mapped to 8-bit fixed-point representations using a uniform quantization method. White noise is injected into the parameter distribution during the quantization process to achieve distribution regularization. The compensation factor is calculated based on the difference in parameter distribution before and after quantization, and the compensation factor is applied to the fixed-point parameter to reduce the quantization error.
[0026] Furthermore, the edge device collects real-time retail scene data, extracts the time series features of commodity operation, customer movement trajectory and shopping behavior to build a sample cache pool, calculates the feature importance based on the sample cache pool, and selectively updates the quantitative model online, including:
[0027] Collect retail scene data streams through video sensors of edge devices, perform target detection on the data streams to extract commodity operation areas, key points of customer bodies and movement trajectories, organize the detection results into feature sequences in time sequence, maintain a sample buffer pool based on a circular queue data structure, and perform time attenuation weighting on the feature sequences in the sample buffer pool;
[0028] The intra-class variance and inter-class distance of the feature sequence in the sample buffer pool are calculated, and the ratio of the intra-class variance to the inter-class distance is used as the feature importance measure. The samples are screened based on the feature importance, and the parameters of the quantization model are incrementally updated using the screened high-quality samples, keeping the quantization accuracy of the key layer unchanged during the update process.
[0029] In a second aspect, the present application provides an adaptive retail behavior recognition model optimization device for edge computing, comprising:
[0030] A model building module is used to build a weight evaluation matrix based on an initial retail behavior recognition model, wherein the initial retail behavior recognition model includes three types of behavior recognition tasks: commodity interaction, checkout operation, and customer movement line. The importance score of each layer of neuron weights is calculated using the L2 norm, and a multi-dimensional evaluation index is generated by combining the importance score with the inter-layer connection density. An adaptive pruning threshold is set according to the evaluation index, and structured pruning is performed layer by layer in a recursive manner. Parameter reconstruction and gradient compensation are performed on the pruned model to obtain a lightweight model.
[0031] A model tuning module, used to construct a quantization perception layer during the training process of the lightweight model, map the model parameters of the quantization perception layer and the numerical distribution of the intermediate activation values to the optimal quantization interval, obtain the gradient sensitivity by calculating the gradient change rate of each layer output to the weight perturbation, calculate the Shannon entropy based on the pixel distribution probability of the layer output feature map to obtain the feature information entropy, calculate the performance index change rate using verification samples in different retail scenarios to establish an adaptive weight function, the verification samples include self-service checkout, shelf merchandise pickup and customer residence behavior, calculate the weight ratio of the gradient sensitivity to the feature information entropy according to the adaptive weight function, apply the weight ratio to the layer importance score calculation, determine the key layer according to the layer importance score and maintain 16-bit floating point precision, perform 8-bit fixed-point quantization on the non-key layer, introduce noise perturbation and compensation mechanism to optimize the quantization error, and generate a quantization model adapted to edge devices;
[0032] The model update module is used to collect real-time retail scene data on edge devices, extract the time series features of product operations, customer movement trajectories and shopping behaviors to build a sample cache pool, calculate the feature importance based on the sample cache pool, and selectively update the quantitative model online, so as to achieve continuous model optimization by combining asynchronous parameter aggregation with incremental learning.
[0033] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method for optimizing an adaptive retail behavior recognition model for edge computing are implemented.
[0034] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for optimizing the adaptive retail behavior recognition model for edge computing.
[0035] In a fifth aspect, the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the adaptive retail behavior recognition model optimization method for edge computing.
[0036] It can be seen from the above technical scheme that the present application provides an adaptive retail behavior recognition model optimization method for edge computing, by constructing a weight evaluation matrix based on the initial retail behavior recognition model, the initial retail behavior recognition model includes three types of behavior recognition tasks: product interaction, settlement operation and customer movement line, and using the L2 norm to calculate the importance score of each layer of neuron weights, combining the importance score with the inter-layer connection density to generate a multi-dimensional evaluation index, and setting an adaptive pruning threshold according to the evaluation index; collecting real-time retail scene data on the edge device, extracting the time series features of product operation, customer movement trajectory and shopping behavior to construct a sample cache pool, calculating the feature importance based on the sample cache pool, and selectively updating the quantitative model online, thereby improving the system's operating efficiency and recognition accuracy on edge devices by building an intelligent model optimization and online update framework. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present application 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 some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0038] Figure 1 This is one of the flow charts of the adaptive retail behavior recognition model optimization method for edge computing in the embodiment of the present application;
[0039] Figure 2 This is a second flow chart of the method for optimizing the adaptive retail behavior recognition model for edge computing in an embodiment of the present application;
[0040] Figure 3 This is a flowchart of the adaptive retail behavior recognition model optimization method for edge computing in the embodiment of the present application.
[0041] Figure 4 This is a fourth flow chart of the method for optimizing the adaptive retail behavior recognition model for edge computing in an embodiment of the present application;
[0042] Figure 5 This is a fifth flow chart of the method for optimizing the adaptive retail behavior recognition model for edge computing in an embodiment of the present application;
[0043] Figure 6 This is a sixth flow chart of the method for optimizing an adaptive retail behavior recognition model for edge computing in an embodiment of the present application;
[0044] Figure 7 This is the seventh flow chart of the method for optimizing the adaptive retail behavior recognition model for edge computing in the embodiment of the present application;
[0045] Figure 8 This is a structural diagram of an adaptive retail behavior recognition model optimization device for edge computing in an embodiment of the present application;
[0046] Fig. 9 It is a schematic diagram of the structure of an electronic device in an embodiment of the present application.
[0047] Reference numerals:
[0048] Electronic device 9600, central processing unit 9100, memory 9140, communication module 9110, input unit 9120, audio processor 9130, display 9160, power supply 9170, buffer memory 9141, application / function storage unit 9142, data storage unit 9143, driver program storage unit 9144, antenna 9111, speaker 9131, microphone 9132. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0050] The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0051] In view of the problems existing in the prior art, the present application provides an adaptive retail behavior recognition model optimization method for edge computing, which constructs a weight evaluation matrix based on an initial retail behavior recognition model, wherein the initial retail behavior recognition model includes three types of behavior recognition tasks: product interaction, settlement operation and customer movement line. The L2 norm is used to calculate the importance score of the weight of each layer of neurons, and a multi-dimensional evaluation index is generated by combining the importance score with the inter-layer connection density. An adaptive pruning threshold is set according to the evaluation index. Real-time retail scene data is collected on the edge device, and the time series features of product operation, customer movement trajectory and shopping behavior are extracted to construct a sample cache pool. The feature importance is calculated based on the sample cache pool, and the quantitative model is selectively updated online. Therefore, by constructing an intelligent model optimization and online update framework, the operating efficiency and recognition accuracy of the system on the edge device can be improved.
[0052] In order to improve the operating efficiency and recognition accuracy of the system on edge devices by building an intelligent model optimization and online update framework, this application provides an embodiment of an adaptive retail behavior recognition model optimization method for edge computing, see Figure 1 The adaptive retail behavior recognition model optimization method for edge computing specifically includes the following contents:
[0053] Step S101: constructing a weight evaluation matrix based on an initial retail behavior recognition model, wherein the initial retail behavior recognition model includes three types of behavior recognition tasks: commodity interaction, checkout operation, and customer movement line; calculating the importance score of each layer of neuron weights using the L2 norm; generating a multi-dimensional evaluation index by combining the importance score with the inter-layer connection density; setting an adaptive pruning threshold according to the evaluation index; performing structured pruning layer by layer in a recursive manner; and performing parameter reconstruction and gradient compensation on the pruned model to obtain a lightweight model;
[0054] Optionally, this embodiment first constructs a multi-task behavior recognition model suitable for retail scenarios. The model adopts a shared backbone network architecture, and sets three parallel branch networks after the backbone network, which are used to identify commodity interaction behaviors (such as commodity picking and putting back), settlement operation behaviors (such as scanning code payment), and customer movement lines (such as shopping path trajectories). In order to achieve model lightweighting, this embodiment innovatively proposes a structured pruning method based on a weight evaluation matrix.
[0055] This embodiment quantitatively analyzes the weight parameters of each convolution kernel and fully connected layer in the model, and uses sparse matrix representation to construct an M×N-dimensional weight evaluation matrix, where M represents the number of input feature channels and N represents the number of output feature channels. The evaluation matrix not only records the numerical values of the weight parameters, but also saves the topological connection relationship between neurons, providing an important basis for subsequent pruning operations.
[0056] This embodiment innovatively represents the weight vector of each layer of neurons as W={w1,w2,...,wn}, and calculates the L2 norm value of the weight vector ||W||2 as the basic score. At the same time, a sliding window mechanism is introduced to calculate the sensitivity change of the weight in the local area, and the product of the basic score and the local sensitivity is used as the importance score of the neuron weight. This scoring method takes into account both the absolute size of the weight and the contribution of the weight to the local feature extraction.
[0057] This embodiment innovatively combines the importance score with the inter-layer connection density when calculating the multi-dimensional evaluation index. The connection density reflects the degree of information flow between neurons, and a higher connection density indicates that the layer plays an important role in feature transfer. Through this combined evaluation method, the ability to extract important features is guaranteed, and the redundant connections of the model can be effectively reduced.
[0058] This embodiment uses an adaptive method to set the pruning threshold based on multi-dimensional evaluation indicators. Specifically, the expected compression rate of each layer is first calculated, and then weighted and combined with the preset reference threshold to obtain a dynamically adjusted pruning threshold. This adaptive threshold setting method can automatically adjust the pruning intensity according to the importance of feature extraction of different layers.
[0059] This embodiment adopts a recursive strategy from shallow to deep when performing structured pruning, starting from the input layer and evaluating and pruning layer by layer. Neuron connections with importance scores lower than the adaptive threshold are deleted, while retaining the skeleton structure and key connections of the network. After pruning, this embodiment optimizes the weights of the remaining neurons through a reparameterization method, and introduces a gradient compensation mechanism to maintain the feature extraction capability of the model.
[0060] In practical applications, this embodiment can effectively solve the problems of high computational complexity and high storage overhead of deep learning models in retail scenarios. Through precise weight importance evaluation and adaptive structured pruning, the number of model parameters and the amount of computation are significantly reduced while maintaining the model recognition accuracy. This solution is particularly suitable for deployment on edge devices with limited computing resources, and can achieve real-time recognition of product interactions, settlement operations, and customer movements. In retail scenarios, the lightweight model can quickly respond to customer behavior and provide timely and reliable data support for intelligent store management.
[0061] Step S102: construct a quantization perception layer during the training process of the lightweight model, map the model parameters of the quantization perception layer and the numerical distribution of the intermediate activation values to the optimal quantization interval, obtain the gradient sensitivity by calculating the gradient change rate of each layer output to the weight perturbation, calculate the Shannon entropy based on the pixel distribution probability of the layer output feature map to obtain the feature information entropy, use the verification samples in different retail scenarios to calculate the performance index change rate to establish an adaptive weight function, the verification samples include self-service checkout, shelf merchandise pickup and customer stay behavior, calculate the weight ratio of the gradient sensitivity to the feature information entropy according to the adaptive weight function, apply the weight ratio to the layer importance score calculation, determine the key layer according to the layer importance score and maintain 16-bit floating point precision, perform 8-bit fixed-point quantization on the non-key layer, introduce noise perturbation and compensation mechanism to optimize the quantization error, and generate a quantization model adapted to the edge device;
[0062] Optionally, this embodiment proposes a model optimization scheme based on quantization perception for the lightweight retail behavior recognition model. First, a quantization operation unit is inserted into each network layer of the model, and the unit includes a floating-point mapping module and a calibration factor calculation module. The floating-point mapping module normalizes the input numerical range to the [-1,1] interval through linear transformation, while the calibration factor calculation module adaptively adjusts the quantization accuracy according to the variance and kurtosis characteristics of the numerical distribution.
[0063] This embodiment innovatively introduces a quantization strategy based on gradient sensitivity during the training process. Specifically, Gaussian noise perturbation is applied to the weight parameters of the quantization perception layer, and the difference in layer output features before and after the perturbation is recorded, and the partial derivative of the feature difference with respect to the weight perturbation is calculated, and the root mean square value of the partial derivative is used as the gradient sensitivity index of the layer. This method can effectively evaluate the sensitivity of different network layers to quantization operations.
[0064] This embodiment performs pixel value distribution analysis on the feature map output by the quantized perception layer, discretizes the pixel values into K equally spaced intervals, and statistically obtains the probability distribution vector P={p1, p2, ..., pk}. Shannon entropy is calculated based on the distribution vector, and the exponential sliding average method is used for time series smoothing to obtain the feature information entropy. This indicator reflects the richness and importance of information in the feature map.
[0065] This embodiment innovatively constructs a set of verification samples that include a variety of retail scenarios, including payment operation sequences in the self-service checkout area, product picking action sequences in the shelf area, and behavior sequences in the customer residence area. By performing model reasoning on these samples, calculating the impact of changes in quantitative parameters on recognition accuracy, and establishing an incremental weight mapping function, the scenario adaptation of the quantitative strategy is achieved.
[0066] This embodiment dynamically adjusts the gradient sensitivity weight ratio α and the feature information entropy weight ratio β according to the adaptive weight function to ensure that α+β=1. This dynamic weight allocation mechanism takes into account the difficulty coefficients of different tasks. For example, in complex tasks such as commodity interaction recognition, the weight ratio of gradient sensitivity is appropriately increased, while in relatively simple tasks such as customer movement tracking, the weight ratio of feature information entropy is increased.
[0067] Based on the comprehensive scoring results, this embodiment determines the network layer with an importance score higher than the dynamic threshold as the key layer, maintaining 16-bit floating point precision. For non-key layers, the uniform quantization method is used to convert the parameters into 8-bit fixed-point representation. In order to optimize the quantization error, white noise perturbation is innovatively introduced to achieve distribution regularization, and the compensation factor is calculated based on the difference in parameter distribution before and after quantization.
[0068] This embodiment effectively solves the problem of limited computing power of edge devices in retail scenarios through quantitative perception training and sophisticated hierarchical quantization strategies. While ensuring model recognition performance, this solution significantly reduces the storage space and computational complexity of the model, allowing the model to run efficiently on resource-constrained edge devices. In practical applications, the quantized model can accurately identify product operations, payment behaviors, and customer trajectories, providing real-time behavioral analysis support for smart retail systems.
[0069] Step S103: Collect real-time retail scene data on the edge device, extract the time series features of product operations, customer movement trajectories and shopping behaviors to build a sample cache pool, calculate the feature importance based on the sample cache pool, selectively update the quantitative model online, and achieve continuous model optimization through a combination of asynchronous parameter aggregation and incremental learning.
[0070] Optionally, in the actual retail scenario, this embodiment collects scene data in real time through edge devices deployed in key locations such as shelf areas and checkout areas. These data include video streams of customers interacting with goods, customer movement trajectory data in the store, and behavioral sequence data during the shopping process. The edge device first pre-processes the collected raw data, including operations such as image denoising, moving target detection, and feature extraction.
[0071] This embodiment innovatively constructs a dynamically updated sample cache pool mechanism. Specifically, for product operation behaviors, the spatiotemporal characteristics of actions such as picking up, putting back, and flipping products are extracted; for customer movement trajectories, the coordinate sequence of key path points and the distribution of dwell time are recorded; for shopping behaviors, the temporal characteristics of typical behaviors such as product browsing, comparison, and settlement are extracted. These features are stored in a structured form in the sample cache pool and organized and managed by timestamp.
[0072] This embodiment adopts an innovative evaluation method for feature importance calculation. First, based on the historical data in the sample buffer pool, the contribution of each type of feature to the behavior recognition result is calculated. Specifically, the importance of a single feature is evaluated by the feature permutation method, that is, while keeping other features unchanged, the target feature is randomly permuted to observe the degree of change in the model prediction result. For features with higher contribution, higher weights are given in subsequent model updates.
[0073] This embodiment innovatively proposes a selective update mechanism for the online update strategy of the quantization model. Based on the feature importance score, only the parameters of the task branch with significantly reduced recognition effect are updated, while other branches with stable performance remain unchanged. This selective update strategy not only ensures the real-time adaptability of the model, but also avoids unnecessary computational overhead.
[0074] This embodiment uses an asynchronous parameter aggregation mechanism to achieve model collaborative optimization between multiple edge devices. Each edge device independently performs local model updates and periodically uploads parameter changes to the central server. The central server uses a weighted average to merge parameter updates from different devices, and the weight coefficient is dynamically adjusted according to the number of samples and data quality of each device.
[0075] This embodiment innovatively combines the incremental learning strategy in the process of continuous model optimization. When enough new samples are accumulated in the sample buffer pool, the incremental learning process is started. In this process, the model maintains the ability to remember the learned samples while gradually adapting to new scene changes. In order to prevent catastrophic forgetting, this embodiment designs an experience playback mechanism, which mixes historical samples and new samples in each update.
[0076] This embodiment effectively solves the problem of real-time adaptability of models in retail scenarios through dynamic sample caching and selective model update strategies. This solution enables edge devices to respond to scene changes in a timely manner and continuously optimize recognition performance. In practical applications, the model can accurately identify the operation behavior of newly added products, adapt to changes in customer shopping habits, and maintain stable recognition effects during special periods such as holidays. At the same time, the asynchronous parameter aggregation mechanism ensures knowledge sharing between multiple devices and improves the intelligence level of the entire retail system.
[0077] From the above description, it can be seen that the adaptive retail behavior recognition model optimization method for edge computing provided in the embodiment of the present application can construct a weight evaluation matrix based on the initial retail behavior recognition model. The initial retail behavior recognition model includes three types of behavior recognition tasks: product interaction, settlement operation and customer movement line. The L2 norm is used to calculate the importance score of the weight of each layer of neurons, and the importance score is combined with the inter-layer connection density to generate a multi-dimensional evaluation index, and an adaptive pruning threshold is set according to the evaluation index; real-time retail scene data is collected on the edge device, and the time series features of product operation, customer movement trajectory and shopping behavior are extracted to construct a sample cache pool, and the feature importance is calculated based on the sample cache pool. The quantitative model is selectively updated online, thereby improving the system's operating efficiency and recognition accuracy on the edge device by building an intelligent model optimization and online update framework.
[0078] In one embodiment of the adaptive retail behavior recognition model optimization method for edge computing of the present application, see Figure 2 , and can also include the following:
[0079] Step S201: quantizing and mapping the weight parameters of each convolution kernel and the fully connected layer in the initial retail behavior recognition model, reconstructing the weight parameters into an M×N dimensional evaluation matrix using a sparse matrix representation method, where M represents the number of input feature channels, and N represents the number of output feature channels, and recording the numerical values and topological connection relationships of the weight parameters in the evaluation matrix;
[0080] Step S202: extract underlying features from the input retail scene image data through a shared backbone network, set up three parallel branch networks after the shared backbone network, and the parallel branch networks respectively include convolution modules and fully connected modules for product interaction, checkout operations, and customer movement line recognition, and adaptively fuse the features between the parallel branch networks based on task relevance.
[0081] Optionally, this embodiment first systematically analyzes the network structure of the initial retail behavior recognition model. By quantizing and mapping the weight parameters of each convolution kernel and fully connected layer, the continuous floating point weights are mapped to a discrete numerical space. This mapping process uses a nonlinear transformation method to ensure that the statistical characteristics of the weight distribution are maintained while compressing the parameter bit width.
[0082] This embodiment innovatively uses sparse matrix representation to construct a weight evaluation matrix. The number of rows M of the matrix corresponds to the number of input feature channels, and the number of columns N corresponds to the number of output feature channels. In the matrix, non-zero elements represent the weight values of the connections, and zero elements represent the absence of connections, thereby effectively capturing the topological structure characteristics of the network. For example, in the commodity identification task, the matrix can reflect the correlation strength between different feature channels, which helps to identify the key feature extraction path.
[0083] This embodiment not only records the numerical value of the weight in the evaluation matrix, but also innovatively introduces the connection importance index. This index comprehensively considers the absolute value of the weight, gradient information, and activation frequency in back propagation, thereby comprehensively evaluating the contribution of each connection to network performance. This multi-dimensional evaluation method provides a reliable basis for subsequent model optimization.
[0084] This embodiment designs a multi-task learning architecture based on a shared backbone network. The shared backbone network adopts a deep residual structure and gradually constructs representations from low-level edge texture features to high-level semantic features through multi-level feature extraction. This hierarchical feature extraction mechanism is particularly suitable for complex visual analysis tasks in retail scenarios.
[0085] This embodiment sets up three dedicated parallel branch networks after the shared backbone network. The commodity interaction branch network focuses on the spatial position changes and hand operation characteristics of commodities, and uses a 3D convolution structure to capture spatiotemporal dependencies. The settlement operation branch network focuses on identifying key actions in payment scenarios, and uses an attention mechanism to highlight the features of important areas. The customer movement branch network models the temporal nature of movement trajectories through a recurrent neural network structure.
[0086] This embodiment innovatively implements a feature adaptive fusion mechanism between parallel branch networks. Based on task relevance analysis, a feature importance weight map is established to dynamically adjust the feature interaction strength between different branches. For example, when a customer is identified to be lingering in front of a shelf, the feature fusion between the product interaction branch and the customer movement branch is enhanced to improve the accuracy of behavior recognition.
[0087] This embodiment effectively solves the complexity problem of behavior recognition in retail scenarios through refined evaluation of weight parameters and multi-task collaborative learning architecture. In practical applications, this solution can accurately capture various behavioral characteristics such as product interaction, payment operations, and customer movement, providing comprehensive behavioral analysis support for smart retail systems. Especially in scenarios where products are densely placed and customers move frequently, the model can still maintain stable recognition performance. At the same time, the design of the shared backbone network significantly reduces computing resource consumption, enabling the model to run in real time on edge devices.
[0088] In one embodiment of the adaptive retail behavior recognition model optimization method for edge computing of the present application, see Figure 3 , and can also include the following:
[0089] Step S301: The weight vector of each layer of neurons is expressed as W={w1,w2,...,wn}, and the L2 norm value ||W||2 of the weight vector is calculated as a basic score, and a sliding window is applied to the weight vector to calculate the local sensitivity, and the importance score of the neuron weight is obtained based on the product of the basic score and the local sensitivity, and the importance score is multiplied by the input-output connection density of the layer to obtain a multi-dimensional evaluation index;
[0090] Step S302: Calculate the expected compression rate of each layer based on the multi-dimensional evaluation index, take the weighted sum of the expected compression rate and the preset benchmark threshold as the adaptive pruning threshold, recursively traverse the network structure from the input layer to the output layer, remove the neuron connections whose weight importance scores are lower than the adaptive pruning threshold, perform re-parameterization on the weights of the remaining neurons, and optimize the distribution of model parameters after pruning by introducing gradient compensation terms.
[0091] Optionally, this embodiment first performs a detailed analysis of the weight vector of each neuron in the neural network. The weight vector W is represented as an n-dimensional vector, where each component represents the connection strength between the neuron and each input node in the previous layer. By calculating the L2 norm value of the weight vector, a basic score reflecting the overall importance of the neuron is obtained. This scoring method can effectively measure the distribution characteristics of weights in high-dimensional space.
[0092] This embodiment innovatively introduces a sliding window mechanism to calculate local sensitivity. Specifically, a sliding window of size k is set, which slides on the weight vector and calculates the impact of the weight change in the window on the neuron output. This local sensitivity analysis method can capture the changes in the importance of weights at different locations, and is particularly suitable for time series feature extraction tasks in retail scenarios.
[0093] This embodiment uses the product of the basic score and the local sensitivity as the importance score to achieve a multi-angle evaluation of the importance of neurons. At the same time, the input-output connection density is innovatively introduced as a regulating factor, which reflects the core degree of the neuron in the network topology. For example, in the commodity recognition task, neurons connected to multiple feature extraction paths tend to have a higher connection density.
[0094] This embodiment dynamically calculates the expected compression rate for each network layer based on multi-dimensional evaluation indicators. The calculation of this compression rate takes into account factors such as the position of the layer, the type of task, and the computational complexity. For example, in the recurrent layer that processes the customer behavior sequence, a relatively conservative compression rate is used due to the importance of timing information; while in the convolutional layer that processes static features, a more aggressive compression strategy can be used.
[0095] This embodiment innovatively designs an adaptive pruning threshold calculation method. The expected compression rate is weighted and combined with the preset reference threshold, and the weight coefficient is dynamically adjusted according to the depth of the network layer and the importance of the task. This adaptive threshold mechanism ensures the flexibility and controllability of the pruning process.
[0096] This embodiment uses a recursive traversal strategy from the input layer to the output layer to perform network pruning. During the traversal process, the connections whose weight importance scores are lower than the adaptive threshold are marked as items to be pruned. This layer-by-layer pruning method can maintain the integrity of the network structure and avoid local over-pruning.
[0097] After the pruning operation, this embodiment reparameterizes the retained neuron weights. This process adjusts the mean and variance of the weight distribution to make the pruned network better adapt to the original data distribution. At the same time, the gradient compensation mechanism is innovatively introduced to reduce the negative impact of the pruning operation on the model performance by adding compensation terms in the back propagation.
[0098] This embodiment effectively solves the problem of lightweight models in retail scenarios through multi-dimensional evaluation and adaptive pruning strategies. In practical applications, the pruned model can maintain the ability to recognize key behavioral features, such as accurately capturing important information such as product operation sequences and customer movement trajectories. At the same time, the computational efficiency of the model is significantly improved, enabling it to run smoothly on resource-constrained edge devices. Especially in scenarios with dense commodities and large traffic, the lightweight model can still maintain stable real-time recognition performance.
[0099] In one embodiment of the adaptive retail behavior recognition model optimization method for edge computing of the present application, see Figure 4 , and can also include the following:
[0100] Step S401: inserting a quantization operation unit into each layer of the network structure of the lightweight model, wherein the quantization operation unit includes a floating-point number mapping module and a calibration factor calculation module, wherein the floating-point number mapping module performs a linear transformation on the input value to normalize the value range to the interval [-1, 1], and the calibration factor calculation module adaptively adjusts the quantization accuracy based on the variance and kurtosis of the value distribution;
[0101] Step S402: During the training process, Gaussian noise perturbation is applied to the weight parameters of the quantized perception layer, and the difference in layer output features before and after the perturbation is recorded. The partial derivative of the feature difference with respect to the weight perturbation is calculated based on back propagation, and the root mean square value of the partial derivative is used as the gradient sensitivity of the layer. The gradient sensitivity is normalized to obtain a standardized score.
[0102] Optionally, this embodiment first designs and inserts a dedicated quantization operation unit in the network layer of the lightweight model. The unit includes two core modules: a floating-point mapping module and a calibration factor calculation module. The floating-point mapping module uniformly maps input values of different magnitudes to the interval [-1,1] through linear transformation. This normalization process provides a standardized numerical basis for subsequent quantization operations.
[0103] This embodiment innovatively adopts a piecewise linear mapping strategy in the floating point number mapping process. For common numerical distribution features in retail scenarios, such as commodity feature vectors, location coordinates, etc., the slope of the mapping function is dynamically adjusted according to their numerical distribution characteristics to ensure that the key numerical interval can maintain a high mapping accuracy.
[0104] This embodiment innovatively introduces an adaptive quantization mechanism based on data distribution characteristics in the calibration factor calculation module. By calculating the variance and kurtosis of the numerical distribution, the discrete degree and peak characteristics of the data are analyzed, and the quantization accuracy is dynamically adjusted. For example, for customer movement trajectory data with violent fluctuations, a higher quantization accuracy is used; for relatively stable commodity feature representations, a lower quantization accuracy can be used to save storage space.
[0105] In the model training process, this embodiment innovatively designs a robustness enhancement method based on Gaussian noise perturbation. By injecting random perturbations into the weight parameters of the quantization perception layer, the quantization errors that may occur in the actual deployment environment are simulated. This perturbation training mechanism improves the model's tolerance to quantization noise.
[0106] This embodiment establishes a quantization sensitivity evaluation mechanism by recording the difference in layer output features before and after weight perturbation. Specifically, the partial derivative of the feature difference with respect to the weight perturbation is calculated, and this partial derivative reflects the sensitivity of the layer to changes in quantization accuracy. For example, in a key layer for identifying commodity operation actions, a higher gradient sensitivity indicates that the layer requires a more precise quantization strategy.
[0107] This embodiment innovatively uses the root mean square value as the metric for gradient sensitivity. This calculation method comprehensively considers the gradient changes in different dimensions and can more comprehensively reflect the quantization sensitivity characteristics of the layer. The gradient sensitivity is normalized to obtain comparable standardized scores, which provides a basis for adjusting the quantization strategy between different layers.
[0108] This embodiment effectively solves the problem of precision loss in the model quantization process through the fine design of the quantization operation unit and the enhancement of robustness during the training process. In actual retail scenarios, the quantized model can maintain the ability to recognize subtle behavioral features, such as accurately capturing small changes in actions such as picking up and putting back goods. At the same time, the performance balance of the model on different task branches is ensured through adaptive quantization precision adjustment.
[0109] This embodiment shows significant advantages when deployed on edge devices. The quantized model not only significantly reduces the storage space requirements, but also improves the efficiency of inference calculations. Especially in complex retail environments where multiple cameras work together, the quantized model can support real-time multi-channel video stream processing and ensure the response speed of the system. At the same time, the robustness enhancement mechanism based on noise perturbation training enables the model to adapt to the differences in quantization implementation on different hardware platforms, ensuring the versatility of deployment.
[0110] In one embodiment of the adaptive retail behavior recognition model optimization method for edge computing of the present application, see Figure 5 , and can also include the following:
[0111] Step S501: Perform pixel value statistics on the feature map output by the quantized perception layer, discretize the pixel value distribution into K equally spaced intervals, count the number of pixels in each interval and normalize them to obtain a probability distribution vector P={p1,p2,...,pk}, and calculate the Shannon entropy H=-∑pi based on the probability distribution vector log(pi) is used as the characteristic information entropy, and the characteristic information entropy is smoothed in time series using the exponential moving average method;
[0112] Step S502: Construct a verification sample set, which includes a payment operation sequence in a self-service checkout scenario, a commodity picking action sequence in the shelf area, and a behavior sequence in the customer residence area. Perform model reasoning on the verification sample set to obtain the recognition accuracy of various tasks, calculate the influence of the change in quantitative parameters on the recognition accuracy, and construct an increasing weight mapping function based on the influence.
[0113] Optionally, this embodiment first performs a detailed pixel value analysis on the feature map output by the quantitative perception layer. By dividing the distribution range of pixel values into K equally spaced intervals, a statistical histogram of the feature values is established. This discretization processing method can effectively capture the numerical distribution characteristics in the feature map, and is particularly suitable for complex visual feature representation in retail scenarios.
[0114] This embodiment innovatively uses probability distribution vectors to describe the statistical characteristics of feature maps. By normalizing the number of pixels in each interval, a probability vector P reflecting the numerical distribution density is obtained. This probability representation method provides a reliable mathematical basis for subsequent information entropy calculations. In practical applications, this probability distribution can effectively reflect the statistical laws of key visual features such as product characteristics and human posture.
[0115] This embodiment calculates feature information entropy based on Shannon entropy theory. The information richness of the quantitative feature is obtained by weighted summing the logarithm of each component of the probability distribution vector. This entropy measurement method is particularly suitable for evaluating the complexity of behavioral features in retail scenarios. For example, in the process of commodity interaction, higher information entropy usually means more complex operation behavior.
[0116] This embodiment innovatively introduces an exponential moving average mechanism to perform time series smoothing on the feature information entropy. This smoothing process can suppress the impact of short-term fluctuations, retain long-term change trends, and make the evaluation of feature complexity more stable and reliable. For example, in a continuous customer behavior sequence, the smoothed entropy value can better reflect the overall changes in the behavior pattern.
[0117] This embodiment designs a targeted validation sample set. This set contains a variety of typical behavior sequences in self-service checkout scenarios, such as payment operations, product pickup, and customer stay. This diverse validation set design ensures the comprehensiveness of quantitative evaluation. By performing model reasoning on these samples, the impact of quantization on different types of tasks can be fully evaluated.
[0118] This embodiment innovatively analyzes the impact of changes in quantization parameters on recognition accuracy. By controlling the variable method, the quantization accuracy is gradually adjusted while keeping other parameters unchanged, and the changing trend of the model performance is recorded. This systematic analysis method provides a reliable experimental basis for the optimization of the quantization strategy.
[0119] This embodiment constructs an increasing weight mapping function based on the degree of influence. The function maps the quantization sensitivity to the weight adjustment factor, and realizes the adaptive allocation of quantization accuracy. For example, for the payment operation recognition task that is sensitive to quantization, a higher quantization accuracy is allocated; while for the relatively stable customer residence recognition, a lower quantization accuracy can be used.
[0120] This embodiment effectively solves the optimization problem of quantization precision allocation through information entropy analysis and verification sample evaluation. In actual retail scenarios, the optimized quantization strategy can minimize storage and computing overhead while maintaining model performance. Especially in the scenario of processing multiple video streams, the optimized quantization scheme enables the system to achieve real-time processing with limited hardware resources.
[0121] This embodiment shows significant advantages in the edge computing environment. Through adaptive quantization precision allocation, the system can flexibly adjust resource allocation according to the characteristics of different tasks, while ensuring accuracy and improving processing efficiency. This optimization is particularly suitable for deployment on self-service retail terminals with limited computing resources, and can support real-time behavior analysis requirements in complex scenarios.
[0122] In one embodiment of the adaptive retail behavior recognition model optimization method for edge computing of the present application, see Figure 6 , and can also include the following:
[0123] Step S601: multiply the weight coefficient output by the adaptive weight function by the gradient sensitivity and feature information entropy of the corresponding layer respectively, dynamically adjust the weight ratio α of the gradient sensitivity and the weight ratio β of the feature information entropy based on the task difficulty coefficient so that α+β=1, add α times the normalized gradient sensitivity and β times the normalized feature information entropy to obtain the layer importance score, and sort and screen the layer importance scores;
[0124] Step S602: The network layer whose layer importance score is higher than the dynamic threshold is determined as a key layer and the 16-bit floating point precision is maintained. The parameters of the non-key layer are mapped to 8-bit fixed-point representation using a uniform quantization method. White noise is injected into the parameter distribution during the quantization process to achieve distribution regularization. The compensation factor is calculated based on the difference in parameter distribution before and after quantization. The compensation factor is applied to the fixed-point parameter to reduce the quantization error.
[0125] Optionally, this embodiment first performs a weighted combination of the weight coefficient generated by the adaptive weight function and the gradient sensitivity and feature information entropy of each layer. This combination method fully considers the importance of the network layer in the model and can more accurately evaluate the contribution of each layer in the retail scenario task.
[0126] This embodiment innovatively introduces the task difficulty coefficient to dynamically adjust the weight ratio of gradient sensitivity and feature information entropy. For different types of retail scenario tasks, such as complex commodity interaction recognition or simple customer positioning, the system can adaptively adjust the ratio of α and β. For example, when identifying complex payment operations, the weight ratio β of feature information entropy is increased to retain more feature details.
[0127] This embodiment obtains the layer importance score through comprehensive calculation. The normalized gradient sensitivity and feature information entropy are weighted and summed according to the ratio of α and β to obtain a unified measure reflecting the importance of the layer. This scoring mechanism is particularly suitable for evaluating the importance of different functional modules in retail scenarios, such as key components such as product detection and behavior recognition.
[0128] This embodiment screens and optimizes network layers based on layer importance scores. By setting a dynamic threshold, layers with higher scores are identified as key layers, and 16-bit floating point precision is retained for them. This precision preservation strategy ensures the accuracy of the model when processing key features, such as accurately capturing the subtle changes in the movement of picking up and putting back goods.
[0129] This embodiment adopts an 8-bit fixed-point uniform quantization strategy for non-critical layers. In the quantization process, a white noise injection mechanism is innovatively introduced to regularize the parameter distribution. This noise injection method can improve the generalization ability of the quantized model and make it better adapt to the changes in data distribution in the actual deployment environment.
[0130] This embodiment designs a compensation factor correction mechanism by calculating the difference in parameter distribution before and after quantization. The introduction of compensation factors can effectively reduce information loss during the quantization process and maintain the performance of the model on key tasks. For example, when processing payment confirmation in a self-service checkout scenario, the compensation mechanism ensures that the quantized model can still accurately identify the user's subtle operation actions.
[0131] The dynamic quantization strategy of this embodiment shows significant advantages in practical applications. Through accurate layer importance evaluation and adaptive quantization precision allocation, the model can significantly reduce storage and computing overhead while maintaining key functional performance. Especially in the scenario of processing multi-camera data streams, the optimized model can support real-time behavior analysis needs.
[0132] The deployment effect of this embodiment on edge computing devices is significant. Through reasonable precision allocation and quantization compensation, the system can maintain stable recognition performance under limited computing resources. This optimization is particularly suitable for use in resource-constrained scenarios such as self-service retail terminals, which ensures real-time performance and maintains recognition accuracy.
[0133] This embodiment significantly improves the deployment efficiency of the model through quantitative optimization. In actual retail scenarios, the optimized model can handle behavioral analysis tasks of multiple video streams at the same time, supporting real-time monitoring and analysis requirements in complex scenarios. Through dynamic weight adjustment and compensation mechanism, the system can maintain stable performance under different task types.
[0134] In one embodiment of the adaptive retail behavior recognition model optimization method for edge computing of the present application, see Figure 7 , and can also include the following:
[0135] Step S701: Collect retail scene data streams through the video sensor of the edge device, perform target detection on the data stream to extract commodity operation areas, customer body key points and movement trajectories, organize the detection results into feature sequences in time sequence, maintain a sample buffer pool based on a circular queue data structure, and perform time attenuation weighting on the feature sequences in the sample buffer pool;
[0136] Step S702: Calculate the intra-class variance and inter-class distance of the feature sequence in the sample buffer pool, use the ratio of the intra-class variance to the inter-class distance as a feature importance measure, screen the samples based on the feature importance, and use the screened high-quality samples to incrementally update the parameters of the quantization model, keeping the quantization accuracy of the key layer unchanged during the update process.
[0137] Optionally, this embodiment uses the video sensors of edge devices to collect data streams of retail scenes in real time. Video sensors deployed in the self-service checkout area and the commodity shelf area can capture customers' shopping behaviors and commodity operation actions in all directions. Through the target detection algorithm, the system can accurately locate and track the movement of items in the commodity operation area, and extract the key point information of the customer's body.
[0138] This embodiment innovatively designs a feature organization method based on time series. The detected target position, human posture, movement trajectory and other information are organized into a feature sequence in time order. This time series feature representation method is particularly suitable for describing continuous behaviors in retail scenarios, such as typical operation sequences such as picking up goods, checking prices, and putting them in shopping carts.
[0139] This embodiment uses a circular queue data structure to achieve efficient sample cache management. The cache pool stores the latest feature sequence and automatically updates samples through a first-in-first-out mechanism. The innovative introduction of a time-decay weighting mechanism gives recent samples a higher importance, which is particularly suitable for processing dynamically changing features in retail scenarios.
[0140] This embodiment establishes a feature importance evaluation mechanism by calculating the intra-class variance and inter-class distance of the feature sequence in the sample buffer pool. The intra-class variance reflects the stability of the same type of behavior features, while the inter-class distance reflects the separability of different types of behaviors. For example, in a commodity interaction scenario, a stable picking action will show a smaller intra-class variance, while maintaining a larger inter-class distance with the putting action.
[0141] This embodiment performs sample screening based on feature importance. By setting a threshold for the ratio of intra-class variance to inter-class distance, representative high-quality samples are screened out. This screening mechanism ensures that the samples used for model update have good discrimination and stability. For example, in a self-service checkout scenario, the system can screen out a standard payment operation sequence as an update sample.
[0142] This embodiment innovatively designs an incremental update strategy for the quantization model. Using the screened high-quality samples, the system can locally optimize the model parameters without affecting the overall performance. Special attention is paid to maintaining the quantization accuracy of the key layers to ensure that the model's recognition ability on the core tasks is not affected.
[0143] This embodiment shows excellent adaptability when dealing with dynamic scene changes. Through real-time sample collection and screening mechanisms, the system can capture new changes in retail scenes in a timely manner and maintain the timeliness of the model through incremental updates. For example, when new product display methods or customer operation modes appear, the system can quickly adapt to these changes.
[0144] The online learning mechanism of this embodiment significantly improves the practicality of the model. In actual retail scenarios, the system can continuously optimize the ability to recognize different types of behaviors while maintaining computational efficiency. In particular, when dealing with diverse customer behaviors, the optimized model shows stronger generalization capabilities.
[0145] This embodiment effectively solves the model adaptability problem through feature importance-driven sample screening and incremental update strategies. In actual applications in retail scenarios, the system can maintain stable recognition performance and have good environmental adaptability, providing reliable technical support for the intelligent upgrade of self-service retail services.
[0146] In order to improve the operating efficiency and recognition accuracy of the system on edge devices by building an intelligent model optimization and online update framework, the present application provides an embodiment of an adaptive retail behavior recognition model optimization device for edge computing for implementing all or part of the contents of the adaptive retail behavior recognition model optimization method for edge computing, see Figure 8 The adaptive retail behavior recognition model optimization device for edge computing specifically includes the following contents:
[0147] A model building module 10 is used to build a weight evaluation matrix based on an initial retail behavior recognition model, wherein the initial retail behavior recognition model includes three types of behavior recognition tasks: commodity interaction, checkout operation, and customer movement line. The importance score of each layer of neuron weights is calculated using the L2 norm, and a multi-dimensional evaluation index is generated by combining the importance score with the inter-layer connection density. An adaptive pruning threshold is set according to the evaluation index, and structured pruning is performed layer by layer in a recursive manner. Parameter reconstruction and gradient compensation are performed on the pruned model to obtain a lightweight model.
[0148] A model tuning module 20 is used to construct a quantization perception layer during the training process of the lightweight model, map the model parameters of the quantization perception layer and the numerical distribution of the intermediate activation values to the optimal quantization interval, obtain the gradient sensitivity by calculating the gradient change rate of each layer output to the weight perturbation, calculate the Shannon entropy based on the pixel distribution probability of the layer output feature map to obtain the feature information entropy, calculate the performance index change rate using verification samples in different retail scenarios to establish an adaptive weight function, the verification samples include self-service checkout, shelf merchandise pickup and customer residence behavior, calculate the weight ratio of the gradient sensitivity to the feature information entropy according to the adaptive weight function, apply the weight ratio to the layer importance score calculation, determine the key layer according to the layer importance score and maintain 16-bit floating point precision, perform 8-bit fixed-point quantization on the non-key layer, introduce noise perturbation and compensation mechanism to optimize the quantization error, and generate a quantization model adapted to the edge device;
[0149] The model update module 30 is used to collect real-time retail scene data on edge devices, extract the time series features of product operations, customer movement trajectories and shopping behaviors to build a sample cache pool, calculate the feature importance based on the sample cache pool, and selectively update the quantitative model online, so as to achieve continuous optimization of the model by combining asynchronous parameter aggregation with incremental learning.
[0150] From the above description, it can be seen that the adaptive retail behavior recognition model optimization device for edge computing provided in the embodiment of the present application can construct a weight evaluation matrix based on the initial retail behavior recognition model. The initial retail behavior recognition model includes three types of behavior recognition tasks: product interaction, settlement operation and customer movement line. The L2 norm is used to calculate the importance score of the weight of each layer of neurons, and the importance score is combined with the inter-layer connection density to generate a multi-dimensional evaluation index. The adaptive pruning threshold is set according to the evaluation index; real-time retail scene data is collected on the edge device, and the time series features of product operation, customer movement trajectory and shopping behavior are extracted to construct a sample cache pool. The feature importance is calculated based on the sample cache pool, and the quantitative model is selectively updated online. Therefore, by constructing an intelligent model optimization and online update framework, the system's operating efficiency and recognition accuracy on the edge device can be improved.
[0151] From the hardware level, in order to improve the operating efficiency and recognition accuracy of the system on the edge device by building an intelligent model optimization and online update framework, the present application provides an embodiment of an electronic device for implementing all or part of the content of the adaptive retail behavior recognition model optimization method for edge computing, and the electronic device specifically includes the following content:
[0152] Processor, memory, communication interface and bus; wherein the processor, memory and communication interface communicate with each other through the bus; the communication interface is used to realize information transmission between the adaptive retail behavior recognition model optimization device for edge computing and related devices such as core business systems, user terminals and related databases; the logic controller can be a desktop computer, a tablet computer and a mobile terminal, etc., but the present embodiment is not limited thereto. In the present embodiment, the logic controller can be implemented with reference to the embodiment of the adaptive retail behavior recognition model optimization method for edge computing and the embodiment of the adaptive retail behavior recognition model optimization device for edge computing in the embodiment, and the contents thereof are incorporated herein, and the repeated parts are not repeated.
[0153] It is understandable that the user terminal may include a smart phone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a personal digital assistant (PDA), a vehicle-mounted device, a smart wearable device, etc. Among them, the smart wearable device may include smart glasses, a smart watch, a smart bracelet, etc.
[0154] In practical applications, part of the method for optimizing the adaptive retail behavior recognition model for edge computing can be performed on the electronic device side as described above, or all operations can be completed in the client device. The selection can be made based on the processing capability of the client device and the limitations of the user's usage scenario. This application does not limit this. If all operations are completed in the client device, the client device may also include a processor.
[0155] The client device may have a communication module (i.e., a communication unit) that can communicate with a remote server to achieve data transmission with the server. The server may include a server on the task scheduling center side, and other implementation scenarios may also include a server on an intermediate platform, such as a server on a third-party server platform that has a communication link with the task scheduling center server. The server may include a single computer device, or a server cluster consisting of multiple servers, or a server structure of a distributed device.
[0156] Fig. 9 FIG. 9 is a schematic block diagram of the system structure of the electronic device 9600 according to an embodiment of the present application. Fig. 9 As shown, the electronic device 9600 may include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. It is worth noting that Fig. 9is exemplary; other types of structures may also be used to supplement or replace this structure to implement telecommunication functions or other functions.
[0157] In one embodiment, the function of the adaptive retail behavior recognition model optimization method for edge computing can be integrated into the central processing unit 9100. The central processing unit 9100 can be configured to perform the following control:
[0158] Step S101: constructing a weight evaluation matrix based on an initial retail behavior recognition model, wherein the initial retail behavior recognition model includes three types of behavior recognition tasks: commodity interaction, checkout operation, and customer movement line; calculating the importance score of each layer of neuron weights using the L2 norm; generating a multi-dimensional evaluation index by combining the importance score with the inter-layer connection density; setting an adaptive pruning threshold according to the evaluation index; performing structured pruning layer by layer in a recursive manner; and performing parameter reconstruction and gradient compensation on the pruned model to obtain a lightweight model;
[0159] Step S102: construct a quantization perception layer during the training process of the lightweight model, map the model parameters of the quantization perception layer and the numerical distribution of the intermediate activation values to the optimal quantization interval, obtain the gradient sensitivity by calculating the gradient change rate of each layer output to the weight perturbation, calculate the Shannon entropy based on the pixel distribution probability of the layer output feature map to obtain the feature information entropy, use the verification samples in different retail scenarios to calculate the performance index change rate to establish an adaptive weight function, the verification samples include self-service checkout, shelf merchandise pickup and customer stay behavior, calculate the weight ratio of the gradient sensitivity to the feature information entropy according to the adaptive weight function, apply the weight ratio to the layer importance score calculation, determine the key layer according to the layer importance score and maintain 16-bit floating point precision, perform 8-bit fixed-point quantization on the non-key layer, introduce noise perturbation and compensation mechanism to optimize the quantization error, and generate a quantization model adapted to the edge device;
[0160] Step S103: Collect real-time retail scene data on the edge device, extract the time series features of product operations, customer movement trajectories and shopping behaviors to build a sample cache pool, calculate the feature importance based on the sample cache pool, selectively update the quantitative model online, and achieve continuous model optimization through a combination of asynchronous parameter aggregation and incremental learning.
[0161] From the above description, it can be seen that the electronic device provided in the embodiment of the present application constructs a weight evaluation matrix based on the initial retail behavior recognition model. The initial retail behavior recognition model includes three types of behavior recognition tasks: product interaction, settlement operation and customer movement line. The L2 norm is used to calculate the importance score of the weight of each layer of neurons, and the importance score is combined with the inter-layer connection density to generate a multi-dimensional evaluation index, and an adaptive pruning threshold is set according to the evaluation index; real-time retail scene data is collected on the edge device, and the time series features of product operation, customer movement trajectory and shopping behavior are extracted to construct a sample cache pool, and the feature importance is calculated based on the sample cache pool, and the quantitative model is selectively updated online, thereby improving the system's operating efficiency and recognition accuracy on the edge device by building an intelligent model optimization and online update framework.
[0162] In another embodiment, the adaptive retail behavior recognition model optimization device for edge computing can be configured separately from the central processing unit 9100. For example, the adaptive retail behavior recognition model optimization device for edge computing can be configured as a chip connected to the central processing unit 9100, and the function of the adaptive retail behavior recognition model optimization method for edge computing can be implemented through the control of the central processing unit.
[0163] like Fig. 9 As shown, the electronic device 9600 may also include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is worth noting that the electronic device 9600 does not necessarily have to include Fig. 9 In addition, the electronic device 9600 may also include Fig. 9 For components not shown, reference may be made to the prior art.
[0164] like Fig. 9 As shown, the central processing unit 9100 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor device and / or logic device. The central processing unit 9100 receives input and controls the operation of various components of the electronic device 9600.
[0165] The memory 9140 may be, for example, one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices. The above-mentioned information related to the failure may be stored, and a program for executing the relevant information may also be stored. The CPU 9100 may execute the program stored in the memory 9140 to implement information storage or processing, etc.
[0166] The input unit 9120 provides input to the central processing unit 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used to display display objects such as images and texts. The display may be, for example, an LCD display, but is not limited thereto.
[0167] The memory 9140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that saves information even when the power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROMs, etc. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application / function storage unit 9142, which is used to store application programs and function programs or processes for executing the operation of the electronic device 9600 through the central processor 9100.
[0168] The memory 9140 may also include a data storage unit 9143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various drivers for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).
[0169] The communication module 9110 is a transmitter / receiver that sends and receives signals via the antenna 9111. The communication module 9110 (transmitter / receiver) is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.
[0170] Based on different communication technologies, multiple communication modules 9110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless LAN module, etc. The communication module 9110 (transmitter / receiver) is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide an audio output via the speaker 9131 and receive an audio input from the microphone 9132, thereby realizing a common telecommunication function. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 9130 is also coupled to the central processor 9100, so that recording can be performed on the local machine through the microphone 9132, and the sound stored on the local machine can be played through the speaker 9131.
[0171] The embodiments of the present application also provide a computer-readable storage medium capable of implementing all the steps in the method for optimizing an adaptive retail behavior recognition model for edge computing in the above-mentioned embodiment, where the execution subject is a server or a client. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, all the steps in the method for optimizing an adaptive retail behavior recognition model for edge computing in the above-mentioned embodiment are implemented. For example, when the processor executes the computer program, the following steps are implemented:
[0172] Step S101: constructing a weight evaluation matrix based on an initial retail behavior recognition model, wherein the initial retail behavior recognition model includes three types of behavior recognition tasks: commodity interaction, checkout operation, and customer movement line; calculating the importance score of each layer of neuron weights using the L2 norm; generating a multi-dimensional evaluation index by combining the importance score with the inter-layer connection density; setting an adaptive pruning threshold according to the evaluation index; performing structured pruning layer by layer in a recursive manner; and performing parameter reconstruction and gradient compensation on the pruned model to obtain a lightweight model;
[0173] Step S102: construct a quantization perception layer during the training process of the lightweight model, map the model parameters of the quantization perception layer and the numerical distribution of the intermediate activation values to the optimal quantization interval, obtain the gradient sensitivity by calculating the gradient change rate of each layer output to the weight perturbation, calculate the Shannon entropy based on the pixel distribution probability of the layer output feature map to obtain the feature information entropy, use the verification samples in different retail scenarios to calculate the performance index change rate to establish an adaptive weight function, the verification samples include self-service checkout, shelf merchandise pickup and customer stay behavior, calculate the weight ratio of the gradient sensitivity to the feature information entropy according to the adaptive weight function, apply the weight ratio to the layer importance score calculation, determine the key layer according to the layer importance score and maintain 16-bit floating point precision, perform 8-bit fixed-point quantization on the non-key layer, introduce noise perturbation and compensation mechanism to optimize the quantization error, and generate a quantization model adapted to the edge device;
[0174] Step S103: Collect real-time retail scene data on the edge device, extract the time series features of product operations, customer movement trajectories and shopping behaviors to build a sample cache pool, calculate the feature importance based on the sample cache pool, selectively update the quantitative model online, and achieve continuous model optimization through a combination of asynchronous parameter aggregation and incremental learning.
[0175] From the above description, it can be seen that the computer-readable storage medium provided in the embodiment of the present application constructs a weight evaluation matrix based on the initial retail behavior recognition model, and the initial retail behavior recognition model includes three types of behavior recognition tasks: product interaction, settlement operation and customer movement line. The L2 norm is used to calculate the importance score of the weight of each layer of neurons, and a multi-dimensional evaluation index is generated by combining the importance score and the inter-layer connection density. An adaptive pruning threshold is set according to the evaluation index; real-time retail scene data is collected on the edge device, and the time series features of product operation, customer movement trajectory and shopping behavior are extracted to construct a sample cache pool, and the feature importance is calculated based on the sample cache pool. The quantitative model is selectively updated online, thereby improving the operating efficiency and recognition accuracy of the system on the edge device by building an intelligent model optimization and online update framework.
[0176] The embodiments of the present application also provide a computer program product capable of implementing all the steps in the edge computing-oriented adaptive retail behavior recognition model optimization method in the above-mentioned embodiment, where the execution subject is a server or a client. When the computer program / instruction is executed by a processor, the steps of the edge computing-oriented adaptive retail behavior recognition model optimization method are implemented. For example, the computer program / instruction implements the following steps:
[0177] Step S101: constructing a weight evaluation matrix based on an initial retail behavior recognition model, wherein the initial retail behavior recognition model includes three types of behavior recognition tasks: commodity interaction, checkout operation, and customer movement line; calculating the importance score of each layer of neuron weights using the L2 norm; generating a multi-dimensional evaluation index by combining the importance score with the inter-layer connection density; setting an adaptive pruning threshold according to the evaluation index; performing structured pruning layer by layer in a recursive manner; and performing parameter reconstruction and gradient compensation on the pruned model to obtain a lightweight model;
[0178] Step S102: construct a quantization perception layer during the training process of the lightweight model, map the model parameters of the quantization perception layer and the numerical distribution of the intermediate activation values to the optimal quantization interval, obtain the gradient sensitivity by calculating the gradient change rate of each layer output to the weight perturbation, calculate the Shannon entropy based on the pixel distribution probability of the layer output feature map to obtain the feature information entropy, use the verification samples in different retail scenarios to calculate the performance index change rate to establish an adaptive weight function, the verification samples include self-service checkout, shelf merchandise pickup and customer stay behavior, calculate the weight ratio of the gradient sensitivity to the feature information entropy according to the adaptive weight function, apply the weight ratio to the layer importance score calculation, determine the key layer according to the layer importance score and maintain 16-bit floating point precision, perform 8-bit fixed-point quantization on the non-key layer, introduce noise perturbation and compensation mechanism to optimize the quantization error, and generate a quantization model adapted to the edge device;
[0179] Step S103: Collect real-time retail scene data on the edge device, extract the time series features of product operations, customer movement trajectories and shopping behaviors to build a sample cache pool, calculate the feature importance based on the sample cache pool, selectively update the quantitative model online, and achieve continuous model optimization through a combination of asynchronous parameter aggregation and incremental learning.
[0180] From the above description, it can be seen that the computer program product provided in the embodiment of the present application constructs a weight evaluation matrix based on the initial retail behavior recognition model, and the initial retail behavior recognition model includes three types of behavior recognition tasks: product interaction, settlement operation and customer movement line. The L2 norm is used to calculate the importance score of the weight of each layer of neurons, and a multi-dimensional evaluation index is generated by combining the importance score and the inter-layer connection density. An adaptive pruning threshold is set according to the evaluation index; real-time retail scene data is collected on the edge device, and the time series features of product operation, customer movement trajectory and shopping behavior are extracted to construct a sample cache pool. The feature importance is calculated based on the sample cache pool, and the quantitative model is selectively updated online, thereby improving the operating efficiency and recognition accuracy of the system on the edge device by building an intelligent model optimization and online update framework.
[0181] It should be understood by those skilled in the art that embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0182] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (apparatus), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0183] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0184] These computer program instructions can also be loaded onto a computer or other programmable data processing 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 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.
[0185] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. An adaptive retail behavior recognition model optimization method for edge computing, characterized in that: The method comprises: A weight evaluation matrix is constructed based on the initial retail behavior recognition model, which includes three types of behavior recognition tasks: product interaction, checkout operation, and customer movement. Specifically, it includes: Quantize and map the weight parameters of each convolution kernel and the fully connected layer in the initial retail behavior recognition model, reconstruct the weight parameters into an M×N dimensional evaluation matrix using a sparse matrix representation method, where M represents the number of input feature channels and N represents the number of output feature channels, and the numerical values and topological connection relationships of the weight parameters are recorded in the evaluation matrix; The input retail scene image data is extracted with underlying features through a shared backbone network, and three parallel branch networks are set after the shared backbone network. The parallel branch networks respectively include convolutional modules and fully connected modules for commodity interaction, checkout operations, and customer movement line recognition. The features between the parallel branch networks are adaptively fused based on task relevance; The importance score of each layer of neuron weights is calculated using the L2 norm, and a multi-dimensional evaluation index is generated by combining the importance score with the inter-layer connection density. An adaptive pruning threshold is set according to the evaluation index, and structured pruning is performed layer by layer in a recursive manner. Parameter reconstruction and gradient compensation are performed on the pruned model to obtain a lightweight model, which specifically includes: The weight vector of each layer of neurons is expressed as W={w1,w2,...,wn}, the L2 norm value of the weight vector ||W||2 is calculated as the basic score, the local sensitivity is calculated by applying a sliding window to the weight vector, the importance score of the neuron weight is obtained based on the product of the basic score and the local sensitivity, and the importance score is multiplied by the input and output connection density of the layer to obtain a multi-dimensional evaluation index; Calculate the expected compression rate of each layer based on the multi-dimensional evaluation index, take the weighted sum of the expected compression rate and the preset benchmark threshold as the adaptive pruning threshold, recursively traverse the network structure from the input layer to the output layer, remove the neuron connections whose weight importance scores are lower than the adaptive pruning threshold, perform re-parameterization on the weights of the remaining neurons, and optimize the distribution of model parameters after pruning by introducing a gradient compensation term; During the training process of the lightweight model, a quantized perception layer is constructed, and the numerical distribution of the model parameters and intermediate activation values of the quantized perception layer are mapped to the optimal quantization interval. The corresponding gradient sensitivity is obtained by calculating the gradient change rate of each layer output to the weight perturbation. The Shannon entropy is calculated based on the pixel distribution probability of the layer output feature map to obtain the corresponding feature information entropy. The performance index change rate is calculated using verification samples in different retail scenarios to establish an adaptive weight function. The verification samples include self-service checkout, shelf product picking and customer residence behavior, specifically including: Perform pixel value statistics on the feature map output by the quantized perception layer, discretize the pixel value distribution into K equally spaced intervals, count the number of pixels in each interval and normalize them to obtain a probability distribution vector P={p1,p2,...,pk}, and calculate the Shannon entropy H=-∑pi based on the probability distribution vector log(pi) is used as the characteristic information entropy, and the characteristic information entropy is smoothed in time series using the exponential moving average method; Construct a verification sample set, which includes a payment operation sequence in a self-service checkout scenario, a product picking action sequence in a shelf area, and a behavior sequence in a customer residence area. Perform model reasoning on the verification sample set to obtain the recognition accuracy of various tasks, calculate the degree of influence of changes in quantitative parameters on the recognition accuracy, and construct an increasing weight mapping function based on the degree of influence. Calculating a weight ratio of the gradient sensitivity to the feature information entropy according to the adaptive weight function, applying the weight ratio to layer importance score calculation, determining a key layer according to the layer importance score and maintaining 16-bit floating point precision, performing 8-bit fixed-point quantization on non-key layers, introducing noise disturbance and compensation mechanism to optimize the quantization error, and generating a quantization model adapted to edge devices; Real-time retail scene data is collected on edge devices, and the temporal features of product operations, customer movement trajectories, and shopping behaviors are extracted to build a sample cache pool. The feature importance is calculated based on the sample cache pool, and the quantitative model is selectively updated online. Continuous model optimization is achieved by combining asynchronous parameter aggregation with incremental learning.
2. The method for optimizing an adaptive retail behavior recognition model for edge computing according to claim 1, characterized in that: The method of constructing a quantization perception layer during the training process of the lightweight model, mapping the model parameters of the quantization perception layer and the numerical distribution of the intermediate activation values to the optimal quantization interval, and obtaining the gradient sensitivity by calculating the gradient change rate of each layer output to the weight perturbation includes: Inserting a quantization operation unit into each layer of the network structure of the lightweight model, the quantization operation unit includes a floating-point number mapping module and a calibration factor calculation module, the floating-point number mapping module performs a linear transformation on the input value to normalize the value range to the interval [-1, 1], and the calibration factor calculation module adaptively adjusts the quantization accuracy based on the variance and kurtosis of the value distribution; During the training process, Gaussian noise perturbation is applied to the weight parameters of the quantized perception layer, and the difference in layer output features before and after the perturbation is recorded. The partial derivative of the feature difference with respect to the weight perturbation is calculated based on back propagation, and the root mean square value of the partial derivative is used as the gradient sensitivity of the layer. The gradient sensitivity is normalized to obtain a standardized score.
3. The method for optimizing an adaptive retail behavior recognition model for edge computing according to claim 1, characterized in that: The weight ratio of the gradient sensitivity to the feature information entropy is calculated according to the adaptive weight function, the weight ratio is applied to the layer importance score calculation, the key layer is determined according to the layer importance score and the 16-bit floating point precision is maintained, the non-key layer is quantized with 8-bit fixed point, the noise disturbance and compensation mechanism is introduced to optimize the quantization error, and a quantization model adapted to the edge device is generated, including: The weight coefficient output by the adaptive weight function is multiplied by the gradient sensitivity and feature information entropy of the corresponding layer respectively, and the weight ratio α of the gradient sensitivity and the weight ratio β of the feature information entropy are dynamically adjusted based on the task difficulty coefficient so that α+β=1, and the layer importance score is obtained by adding α times the normalized gradient sensitivity and β times the normalized feature information entropy, and the layer importance scores are sorted and screened; The network layers whose layer importance scores are higher than the dynamic threshold are determined as key layers and the 16-bit floating point precision is maintained. The parameters of the non-key layers are mapped to 8-bit fixed-point representations using a uniform quantization method. White noise is injected into the parameter distribution during the quantization process to achieve distribution regularization. The compensation factor is calculated based on the difference in parameter distribution before and after quantization, and the compensation factor is applied to the fixed-point parameter to reduce the quantization error.
4. The method for optimizing an adaptive retail behavior recognition model for edge computing according to claim 1, characterized in that: The method collects real-time retail scene data on the edge device, extracts the time series features of commodity operation, customer movement trajectory and shopping behavior to build a sample cache pool, calculates the feature importance based on the sample cache pool, and selectively updates the quantitative model online, including: Collect retail scene data streams through video sensors of edge devices, perform target detection on the data streams to extract commodity operation areas, key points of customer bodies and movement trajectories, organize the detection results into feature sequences in time sequence, maintain a sample buffer pool based on a circular queue data structure, and perform time attenuation weighting on the feature sequences in the sample buffer pool; The intra-class variance and inter-class distance of the feature sequence in the sample buffer pool are calculated, and the ratio of the intra-class variance to the inter-class distance is used as the feature importance measure. The samples are screened based on the feature importance, and the parameters of the quantization model are incrementally updated using the screened high-quality samples, keeping the quantization accuracy of the key layer unchanged during the update process.
5. An adaptive retail behavior recognition model optimization device for edge computing, characterized in that: The device comprises: Model building modules for A weight evaluation matrix is constructed based on the initial retail behavior recognition model, which includes three types of behavior recognition tasks: product interaction, checkout operation, and customer movement. Specifically, it includes: Quantize and map the weight parameters of each convolution kernel and the fully connected layer in the initial retail behavior recognition model, reconstruct the weight parameters into an M×N dimensional evaluation matrix using a sparse matrix representation method, where M represents the number of input feature channels and N represents the number of output feature channels, and the numerical values and topological connection relationships of the weight parameters are recorded in the evaluation matrix; The input retail scene image data is extracted with underlying features through a shared backbone network, and three parallel branch networks are set after the shared backbone network. The parallel branch networks respectively include convolutional modules and fully connected modules for commodity interaction, checkout operations, and customer movement line recognition. The features between the parallel branch networks are adaptively fused based on task relevance; The importance score of each layer of neuron weights is calculated using the L2 norm, and a multi-dimensional evaluation index is generated by combining the importance score with the inter-layer connection density. An adaptive pruning threshold is set according to the evaluation index, and structured pruning is performed layer by layer in a recursive manner. Parameter reconstruction and gradient compensation are performed on the pruned model to obtain a lightweight model, which specifically includes: The weight vector of each layer of neurons is expressed as W={w1,w2,...,wn}, the L2 norm value of the weight vector ||W||2 is calculated as the basic score, the local sensitivity is calculated by applying a sliding window to the weight vector, the importance score of the neuron weight is obtained based on the product of the basic score and the local sensitivity, and the importance score is multiplied by the input and output connection density of the layer to obtain a multi-dimensional evaluation index; Calculate the expected compression rate of each layer based on the multi-dimensional evaluation index, take the weighted sum of the expected compression rate and the preset benchmark threshold as the adaptive pruning threshold, recursively traverse the network structure from the input layer to the output layer, remove the neuron connections whose weight importance scores are lower than the adaptive pruning threshold, perform re-parameterization on the weights of the remaining neurons, and optimize the distribution of model parameters after pruning by introducing a gradient compensation term; Model tuning module for During the training process of the lightweight model, a quantized perception layer is constructed, and the numerical distribution of the model parameters and intermediate activation values of the quantized perception layer are mapped to the optimal quantization interval. The corresponding gradient sensitivity is obtained by calculating the gradient change rate of each layer output to the weight perturbation. The Shannon entropy is calculated based on the pixel distribution probability of the layer output feature map to obtain the corresponding feature information entropy. The performance index change rate is calculated using verification samples in different retail scenarios to establish an adaptive weight function. The verification samples include self-service checkout, shelf product picking and customer residence behavior, specifically including: Perform pixel value statistics on the feature map output by the quantized perception layer, discretize the pixel value distribution into K equally spaced intervals, count the number of pixels in each interval and normalize them to obtain a probability distribution vector P={p1,p2,...,pk}, and calculate the Shannon entropy H=-∑pi based on the probability distribution vector log(pi) is used as the characteristic information entropy, and the characteristic information entropy is smoothed in time series using the exponential moving average method; Construct a verification sample set, which includes a payment operation sequence in a self-service checkout scenario, a product picking action sequence in a shelf area, and a behavior sequence in a customer residence area. Perform model reasoning on the verification sample set to obtain the recognition accuracy of various tasks, calculate the degree of influence of changes in quantitative parameters on the recognition accuracy, and construct an increasing weight mapping function based on the degree of influence. Calculating a weight ratio of the gradient sensitivity to the feature information entropy according to the adaptive weight function, applying the weight ratio to layer importance score calculation, determining a key layer according to the layer importance score and maintaining 16-bit floating point precision, performing 8-bit fixed-point quantization on non-key layers, introducing noise disturbance and compensation mechanism to optimize the quantization error, and generating a quantization model adapted to edge devices; The model update module is used to collect real-time retail scene data on edge devices, extract the time series features of product operations, customer movement trajectories and shopping behaviors to build a sample cache pool, calculate the feature importance based on the sample cache pool, and selectively update the quantitative model online, so as to achieve continuous model optimization by combining asynchronous parameter aggregation with incremental learning.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the adaptive retail behavior recognition model optimization method for edge computing described in any one of claims 1 to 4 are implemented.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the adaptive retail behavior recognition model optimization method for edge computing described in any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Remote sensing image classification method based on pruning compressed neural network
CN112132062A
Vehicle driving environment abnormality monitoring method and apparatus, electronic device, and storage medium
WO2022213336A1