A brand identification recognition method and system
Patent Information
- Application Number
- CN202611368633.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-04
- Publication Date
- 2026-10-23
AI Technical Summary
[0007]有鉴于此,本发明的目的在于提供一种品牌标识识别方法及系统,以解决现有技术中品牌标识检测计算量大、检测效率低、对小尺寸及遮挡标识识别效果差、缺乏视频时序信息利用及身份去重能力等问题,从而实现兼顾检测精度与推理速度、充分利用视频时序信息、具备身份去重能力的高效品牌标识识别
(1)采用行人检测与品牌标识检测的级联架构,先通过行人检测定位行人,再在行人检测框区域内进行品牌标识的检测与识别,显著缩小了品牌标识的搜索范围,降低了背景区域的噪声干扰,大幅提升了检测效率与识别精度。
Smart Images

Figure CN122967181A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, specifically to a brand logo recognition method and system. Background Technology
[0002] With the digital transformation of the retail industry, apparel stores are increasingly seeking insights into the consumption preferences of their customers. Understanding the distribution of clothing brands worn by customers can help store operators accurately grasp the brand preferences of their target customer group, thereby optimizing product selection strategies, adjusting display layouts, and developing precise marketing plans.
[0003] Existing technologies have extensively researched brand logo detection in product images. For example, by using object detection algorithms to locate and identify brand logos in images, it's possible to determine whether a product image contains the logo of a specific brand. However, these methods primarily target infringement detection scenarios for static product images and are difficult to directly apply to customer brand preference analysis in apparel stores. Taking the invention patent with publication number CN113780284A as an example, it discloses a brand logo detection method based on object detection and metric learning. This method uses object detection technology to detect candidate brand logo targets in an image, utilizes metric learning technology to extract features from these targets, and finally uses brand logo retrieval to classify the candidate brand logos. However, this solution only independently detects and identifies brand logos in a single static image, failing to address the tracking and temporal accumulation of the same pedestrian in consecutive frames within a video stream. It cannot solve the problem of repeated statistics caused by the same customer appearing repeatedly in a store video stream scenario, nor can it utilize the temporal information of consecutive frames to improve recognition robustness.
[0004] Furthermore, taking the invention patent with publication number CN117252902B as an example, it discloses a single-stage multi-target tracking method based on an attention mechanism. This method extracts features from the current frame image through a backbone network, enhances the spatial and channel dimensions of pedestrian detection features using a discrimination enhancement module, and extracts pedestrian Re-ID features using an identity preservation module. It then uses a hierarchical matching strategy to achieve trajectory association and tracking of the same pedestrian in consecutive frames. However, the core purpose of this scheme is to solve the feature conflict problem between the detection task and the Re-ID task in multi-target tracking scenarios. Its attention mechanism is applied to the backbone network output of pedestrian detection, aiming to enhance the discriminative features of individual pedestrians to improve tracking accuracy. Its detection and recognition objects are all pedestrians themselves, without involving the detection and recognition of brand logos on pedestrian clothing, nor including functions such as temporal confidence accumulation, deduplication, and aggregation statistics of brand logos. Therefore, it cannot be directly applied to the intelligent analysis of customer brand preferences in clothing store scenarios.
[0005] Specifically, existing technologies have the following shortcomings: Existing brand logo detection methods typically perform brand logo search and recognition directly on the entire image, resulting in high computational load, low detection efficiency, and the presence of background interference that can easily lead to false detections, affecting recognition accuracy; Existing methods separate target detection and brand classification into two independent stages or adopt a simple single-stage architecture, failing to fully consider the salient features of the brand logo region during feature extraction, leading to poor recognition performance for small, blurry, or partially occluded brand logos, and lacking effective feature enhancement mechanisms; Existing methods are mainly geared towards brand logo recognition scenarios in static images, lacking effective utilization of continuous frame detection results in video streams, and failing to improve recognition accuracy and robustness through inter-frame information fusion, while also lacking the ability to deduplicatize repeated appearances of the same customer in the video stream.
[0006] Therefore, there is an urgent need in this field for a brand identification method that can balance detection accuracy and inference speed, make full use of video temporal information, and has the ability to deduplicate identities, in order to solve the problems of low identification accuracy, poor real-time performance, and inaccurate data statistics of existing technologies in the scenario of analyzing brand preferences among apparel store customers. Summary of the Invention
[0007] In view of this, the purpose of this invention is to provide a brand logo recognition method and system to solve the problems of large computational load, low detection efficiency, poor recognition effect on small-sized and occluded logos, lack of video temporal information utilization and identity deduplication capability in the prior art, thereby achieving efficient brand logo recognition that balances detection accuracy and inference speed, makes full use of video temporal information, and has identity deduplication capability.
[0008] The specific plan is as follows: Firstly, this application provides a brand identification method, including: The system acquires store video streams, performs pedestrian detection on video frames, and obtains pedestrian detection bounding boxes. It inputs the image regions corresponding to the pedestrian detection bounding boxes into a brand logo detection and recognition model, and performs attention enhancement processing on the feature maps output by the backbone network of the model to strengthen the feature responses of brand logos. It then detects and recognizes brand logos within the image regions corresponding to the pedestrian detection bounding boxes, outputting the location and category of the brand logos. The system accumulates temporal confidence scores for the brand logo detection results and confirms the validity of the brand logos based on the accumulated confidence scores. Finally, it aggregates and statistically analyzes the confirmed valid brand logo recognition results according to preset dimensions to generate a brand distribution analysis report.
[0009] Furthermore, the pedestrian detection of video frames is implemented based on a pedestrian detection model, which is constructed based on a single-stage target detection algorithm and uses an anchorless detection mechanism to output pedestrian detection boxes.
[0010] Further, the image region corresponding to the pedestrian detection box is input into the brand logo detection and recognition model, including: scaling the cropped image region to a uniform size before inputting it into the model; the model is constructed based on a single-stage object detection algorithm, using a residual network or a lightweight convolutional network as the backbone network, and performing multi-scale feature fusion through a feature pyramid network; the detection head and classification head of the model share the multi-scale feature maps output by the backbone network and the feature pyramid network, and then pass through independent convolutional branches respectively, the detection head regresses the bounding box offset of the brand logo, and the classification head outputs the category of the brand logo.
[0011] Furthermore, the attention enhancement processing adaptively weights the feature map through a series of channel attention and spatial attention mechanisms. The channel attention mechanism is used to filter key feature channels related to brand identification, and the spatial attention mechanism is used to locate the spatial position response area of the brand identifier in the feature map.
[0012] Furthermore, the channel attention mechanism extracts global semantic information from the feature map through global average pooling and global max pooling, respectively, generates channel weight vectors through a fully connected layer, and multiplies the channel weight vectors element-wise with the original feature map; the spatial attention mechanism performs average pooling and max pooling on the feature map along the channel dimension, generates a spatial weight matrix through a convolutional layer, and multiplies the spatial weight matrix element-wise with the feature map enhanced by channel attention.
[0013] Furthermore, the method also includes: performing inter-frame tracking association on pedestrian detection boxes in consecutive video frames, and assigning a unique tracking identity identifier to the same pedestrian; the object of the temporal confidence accumulation is the brand identifier recognition result within the pedestrian detection box area of the same tracking identity identifier; for the confirmed valid brand identifier recognition result, deduplication is performed in combination with the tracking identity identifier, and the same brand identifier of the same pedestrian is only counted as one valid sample.
[0014] Furthermore, the temporal confidence accumulation adopts a sliding window approach. For each brand identifier detection target in the current frame, the intersection-union ratio (IUU) of its detection box with the brand identifier detection boxes in the same pedestrian detection box in the previous frame is calculated. If the IUU is greater than a preset threshold, it is determined to be a continuous detection result of the same brand identifier, and the confidence score of the detection result is added to the confidence accumulation queue of the brand identifier target. When the sum of the confidence scores in the accumulation queue exceeds the preset accumulation threshold, the brand identifier target is determined as a valid recognition result and its brand category is output.
[0015] Furthermore, the temporal confidence accumulation includes inter-frame confidence weighted fusion; the detection confidence scores output by the brand identifier detection and recognition model in multiple consecutive frames are used as input to perform weighted fusion and update the accumulated fusion confidence, which is calculated as follows: in, Accumulate fusion confidence for the current frame. Detect a confidence score for the brand identifier in the current frame. Accumulate fusion confidence for the previous frame , For the preset attenuation coefficient, ;when When the threshold is exceeded, the brand category of the current frame is output.
[0016] Furthermore, the preset dimensions include the dimensions of all pedestrians, gender, and age group; the aggregated statistics obtain the gender attribute of pedestrians based on the pedestrian attribute recognition model, and obtain the age group attribute of pedestrians based on the pedestrian age estimation model.
[0017] Secondly, this application provides a brand logo recognition system for implementing the brand logo recognition method described above. The system includes: a video acquisition and pedestrian detection module, an attention feature enhancement module, a brand logo detection and recognition module, a temporal confidence accumulation module, and an aggregation module. The video acquisition and pedestrian detection module is used to acquire store video streams, perform pedestrian detection on video frames, and acquire pedestrian detection boxes; The attention feature enhancement module is used to input the image region corresponding to the pedestrian detection box into the brand logo detection and recognition model, and to perform attention enhancement processing on the feature map output by the backbone network of the brand logo detection and recognition model to strengthen the feature response of the brand logo. The brand logo detection and recognition module is used to detect and recognize brand logos in the image area corresponding to the pedestrian detection box, and output the location and category of the brand logo; The time-series confidence accumulation module is used to accumulate the time-series confidence of the detection results of the brand logo, and to confirm the validity of the brand logo based on the accumulated confidence. The aggregation module is used to aggregate and statistically analyze confirmed and valid brand identification results according to preset dimensions, and generate a brand distribution analysis report.
[0018] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) A cascaded architecture of pedestrian detection and brand logo detection is adopted. Pedestrians are located first through pedestrian detection, and then brand logos are detected and recognized within the pedestrian detection box area. This significantly reduces the search range of brand logos, reduces noise interference in the background area, and greatly improves detection efficiency and recognition accuracy.
[0019] (2) By connecting the channel attention mechanism and the spatial attention mechanism, the feature map of the backbone network is recalibrated in terms of channel and spatial dimensions, which enhances the model’s ability to extract features from the brand logo area and effectively improves the recognition effect of small, blurry or partially occluded brand logos.
[0020] (3) Through the synergistic cooperation of temporal confidence accumulation mechanism and inter-frame confidence weighted fusion, the brand logo detection results are targeted for attribution judgment and confidence optimization based on pedestrian tracking identity identification, effectively eliminating noise and false detection in single-frame detection, and significantly improving the accuracy and robustness of brand logo recognition in video scenarios.
[0021] (4) Through the coordination of inter-frame tracking association, temporal confidence accumulation, deduplication and aggregation statistics, the tracking identity identifier is used to distinguish the detection results of different pedestrians in the temporal accumulation stage, serves as the basis for identity deduplication in the deduplication stage, and ensures that the same brand identifier of the same pedestrian is counted as only one valid sample in the statistics stage. There is a clear temporal dependency and information transmission relationship between the four steps. Tracking association provides the identity basis for subsequent steps, temporal accumulation confirms the detection validity on the basis of identity, deduplication eliminates duplicate counts after the validity is confirmed, and aggregation statistics generate the final report after deduplication. Together, they constitute a complete technical link from video stream input to brand distribution statistics output. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0023] Figure 1 A flowchart of a brand identification method provided in an embodiment of the present invention; Figure 2 A structural block diagram of a brand identification system provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention; Figure 4 This is another structural schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0024] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0025] This invention discloses a brand logo recognition method and system. The method narrows the logo search range and reduces background interference through a cascaded architecture of pedestrian detection and brand logo detection. It enhances the model's ability to focus on logo regions by adaptively weighting the backbone network feature map through an attention mechanism. It eliminates single-frame false detections by performing inter-frame fusion of detection results of consecutive video frames through a temporal confidence accumulation mechanism. It achieves accurate deduplication by associating the same customer in the video stream with their identity through a pedestrian re-identification algorithm. Thus, it achieves the design goal of efficient brand logo recognition that balances detection accuracy and inference speed, makes full use of video temporal information, and has the ability to deduplicat identities.
[0026] Please see Figure 1 In this embodiment of the invention, a brand identification method is provided. Specifically, it includes the following steps: S10: Obtain the store video stream, perform pedestrian detection on the video frames, and obtain pedestrian detection boxes.
[0027] Specifically, the pedestrian detection algorithm is based on a pedestrian detection model. The construction and training process of the pedestrian detection model is as follows: First, a pedestrian detection dataset is constructed by collecting surveillance videos from clothing store scenes. Images containing pedestrians are extracted from the video frames, and rectangular boxes are used to label the pedestrians in the images. The training data covers scenes under different lighting conditions, different shooting angles, and different pedestrian densities. The detection model is built based on the YOLOv8 single-stage object detection algorithm, using CSPDarknet as the backbone network for feature extraction and employing an anchorless detection mechanism. During training, a Mosaic data augmentation strategy is used, combining four images into one image through random scaling and arrangement to expand the dataset. The CIoULoss loss function is used to improve the quality of bounding box regression. During model training, pedestrians are detected as a single category, with the category confidence parameter set between 0.3 and 0.5 to maintain a high recall rate while ensuring detection accuracy. By inputting the store video stream frame by frame into the trained pedestrian detection model, the model can output the position coordinates of all pedestrians and pedestrian detection boxes in each frame.
[0028] Optionally, inter-frame tracking association is performed on pedestrian detection boxes in consecutive video frames to assign a unique tracking identity to the same pedestrian. Based on the intersection-union ratio (IU) of the inter-frame detection boxes and the similarity of pedestrian appearance features, the pedestrian detection boxes detected in the current frame are matched and associated with existing pedestrian detection boxes in the previous frame. For each pedestrian detection box in the current frame, its IU with each pedestrian detection box in the previous frame is calculated, and the matching pair with the largest IU is found. If the IU is greater than a preset threshold, usually set to 0.5, it is determined to be a continuous detection result of the same pedestrian, and the pedestrian detection box is associated with the corresponding pedestrian tracking identity in the previous frame; if there is a newly added pedestrian detection box in the current frame that has not been associated, a new tracking identity is assigned to it. In this way, it is ensured that the detection results of the same pedestrian in different video frames can be stably associated, providing an identity basis for the subsequent temporal accumulation and deduplication of brand identity. This tracking identity will subsequently be used by the temporal confidence accumulation mechanism to distinguish the brand identity detection results of different pedestrians, and will be used as the basis for identity deduplication in the deduplication step.
[0029] S20, the image region corresponding to the pedestrian detection box is input into the brand logo detection and recognition model, and attention enhancement processing is performed on the feature map output by the backbone network of the brand logo detection and recognition model. The attention enhancement processing is used to strengthen the feature response of the brand logo.
[0030] Specifically, the brand logo detection and recognition model is built based on a single-stage object detection algorithm, performing detection and classification inference only within the image region corresponding to the pedestrian detection box. The cropped pedestrian detection box image region is scaled to a uniform size (e.g., 416×416 pixels) before being input into the brand logo detection and recognition model. The attention mechanism, within the processing flow of the brand logo detection and recognition model, acts between the feature layers at various scales output by the backbone network and the detection and classification heads, recalibrating the channel and spatial dimensions of the feature maps output by the backbone network. It is important to emphasize that this attention enhancement processing is an adaptive weighting of the feature map weights, not a cropping of the image region; the pedestrian detection box is only used to limit the inference region of the brand logo model, i.e., only the image sub-region corresponding to the detection box is scaled to a uniform size before being input into the model, and the attention mechanism enhances the features within this region; the two are cascaded and interconnected.
[0031] Let the input feature map be ,in , , These represent the number of channels, height, and width, respectively. The attention mechanism consists of a channel attention sub-component and a spatial attention sub-component connected in series. This invention uses a series structure instead of a parallel structure because the channel attention mechanism is used to filter key feature channels related to brand identification, and its output directly affects the feature map content processed by the subsequent spatial attention mechanism. If a parallel structure is used, the channel attention and spatial attention process the original feature maps independently before merging, and the key feature channel information filtered by the channel attention cannot be used by the spatial attention mechanism. This would require the spatial attention mechanism to still perform spatial position response calculations across the entire image, reducing the efficiency of the attention mechanism in focusing on the brand identification region features. The series structure allows the channel attention mechanism to first recalibrate the input feature map in terms of channel dimensions, highlighting the responses of key feature channels, and then input the channel-enhanced feature map into the spatial attention mechanism for spatial position response enhancement. This achieves a progressive feature enhancement in both channel and spatial dimensions, which can more effectively guide the model to focus on the brand identification region.
[0032] In the channel attention sub-part, the input feature map First, global semantic information of the feature map is extracted using global average pooling and global max pooling, respectively, resulting in two... The feature vectors are then input into a fully connected layer with shared weights for nonlinear transformation. This fully connected layer has a two-layer structure, with the first layer containing 100 neurons. , The ReLU activation function is applied to determine the number of channels in the input feature map; the number of neurons in the second layer is restored to the original number of channels. There is no activation function; then the two feature vectors output by the fully connected layer are added element-wise, and the channel weight vectors are generated by passing them through the Sigmoid activation function. Finally, the channel weight vector Compared with the original feature map Element-wise multiplication yields the channel-enhanced feature map. To further quantify the contribution of each feature channel to brand identification, this invention introduces a channel discriminative power score in the channel attention sub-part. Let the first... The attention weights for each channel are: The feature map of this channel is Then the channel The discriminative score is defined as follows: in, , and Channels The maximum, minimum, and standard deviation of the feature map. This is a minimal constant. The score comprehensively reflects the attention weights of the channels and the distribution characteristics of the feature responses within each channel. During the model inference phase, the highest-scoring channels can be dynamically retained based on their discriminative power scores. One channel, ,in The channel reservation ratio is set to 0.3 to 0.7 to further suppress interference from redundant channels and enhance the discriminative power of brand identity features.
[0033] In the spatial attention sub-part, the feature map after input channel enhancement. Average pooling and max pooling are performed on the channel dimension respectively to obtain two... Spatial feature maps; concatenate the two spatial feature maps along the channel dimension, and then perform a convolution with a kernel size of 7. 7. A convolutional layer with a stride of 1 and padding of 3, along with a sigmoid activation function, generates a spatial weight matrix. ; Spatial weight matrix With feature map Element-wise multiplication yields the final enhanced feature map. .
[0034] Through the cascaded processing of the aforementioned channel attention mechanism and spatial attention mechanism, the model can adaptively filter key feature channels related to brand identifier discrimination and locate the spatial position response region of the brand identifier in the feature map. To further enhance the attention mechanism's ability to focus on the brand identifier region during the training phase, this invention introduces a region focusing loss function. Let the spatial mask corresponding to the brand identifier bounding box be... The value inside the annotation box is 1, and the value outside the annotation box is 0; the spatial weight matrix output by the spatial attention sub-part is... The region focusing loss is defined as: in For spatial location index on the feature map, The constant is minimized to prevent division by zero. This loss function encourages spatial attention weights to concentrate on the brand logo label area; that is, the more concentrated the spatial attention weights are inside the label area, the better. The smaller the value, the greater the loss function for model training, which is the detection loss. Weighted sum of regional focus loss: in This is the weighting coefficient for the region focusing loss, with a value ranging from 0.1 to 0.5.
[0035] S30, detect and identify the brand logo in the image area corresponding to the pedestrian detection box, and output the location and category of the brand logo.
[0036] Specifically, brand logo detection and recognition are achieved based on a brand logo detection and recognition model. The construction and training process of the brand logo detection and recognition model is as follows: First, a brand logo detection and recognition dataset is constructed, collecting logo image samples from common clothing stores, covering 30 common clothing brands, including sports brands, casual brands, and luxury brands. For each brand, at least 2000 positive sample images are collected, covering different lighting, angles, degrees of occlusion, and logo sizes. Simultaneously, 5000 pedestrian images without any brand logos are collected as negative samples to reduce the false detection rate. All brand logos in the images are labeled with rectangular bounding boxes and brand category labels, and divided into training, validation, and test sets in a 7:2:1 ratio.
[0037] The detection model is built upon a single-stage object detection algorithm, using a residual network or lightweight convolutional network as the backbone for feature extraction, and a feature pyramid network for multi-scale feature fusion. In the design of the detection and classification heads, both share the multi-scale feature maps output by the backbone network and the feature pyramid, but each uses independent convolutional layer branches after the feature maps: the detection head uses a regression branch to predict bounding box offsets, and the classification head uses a classification branch to predict class probabilities. This design allows the localization and classification tasks to share low-level features while retaining their respective task-specific high-level abstraction capabilities. As an optional specific embodiment, the backbone network can be implemented using a ResNet-50 residual network. ResNet-50 effectively alleviates the gradient vanishing problem in deep network training through its residual connection structure, enabling the extraction of brand identifier features with strong discriminative power. ResNet-50 sequentially passes the input image through convolutional layers, batch normalization layers, ReLU activation layers, and max pooling layers for initial feature extraction, and then sequentially passes it through four residual modules for progressive downsampling and channel expansion, outputting feature maps of four different scales as input to the feature pyramid network. In an optional embodiment using MobileNet as the backbone network, a depthwise separable convolutional structure is employed, decomposing standard convolution into two independent steps: depthwise convolution and pointwise convolution. This significantly reduces the number of model parameters and computational cost while maintaining high feature extraction capabilities, making it suitable for real-time store video stream analysis scenarios with high inference speed requirements, thereby enhancing the model's ability to detect brand logos of different sizes. During model training, all brand categories are retained, directly outputting specific brand category labels. (Weighted feature map) Input the detection head and classification head of the brand logo detection and recognition model. The detection head is used to regress the candidate box position of the brand logo, and the classification head is used to identify the corresponding brand category. Simultaneously output the position of the brand logo, the corresponding brand category, and the detection confidence score.
[0038] S40, accumulate the time-series confidence scores of the detection results of the brand logo, and confirm the validity of the brand logo based on the accumulated confidence scores.
[0039] Specifically, the temporal confidence accumulation mechanism employs a sliding window approach. For each brand identifier detection target in the current frame, the pedestrian detection box to which the target belongs is first determined. Then, the intersection-union ratio (IUU) of its detection box with the brand identifier detection boxes within the pedestrian detection boxes of the same tracked identity in the previous frame is calculated, and the matching pair with the largest IUU is found. If the IUU is greater than a preset threshold, typically set to 0.5, it is considered a continuous detection result for the same brand identifier, and the confidence score of this detection result is added to the confidence accumulation queue of the brand identifier target. When the sum of the confidence scores in the accumulation queue exceeds the preset accumulation threshold, the brand identifier target is determined as a valid recognition result. Simultaneously, the temporal confidence accumulation mechanism also includes inter-frame confidence weighted fusion, which weights and fuses the detection confidence scores of multiple consecutive frames to update the accumulated fused confidence. The calculation method is as follows: in, Accumulate fusion confidence for the current frame. Detect a confidence score for the brand identifier in the current frame. Accumulate the fusion confidence for the previous frame. The preset attenuation coefficient is where Initial value of cumulative fusion confidence. Set to 0. When When the threshold is exceeded, the brand category of the current frame is output as the final recognition result. If the detection result for the brand logo is not exceeded, it will not be output temporarily and will continue to accumulate in subsequent frames until the accumulated confidence exceeds the threshold or the accumulated frame count exceeds the maximum number of retained frames. Detection results that exceed the maximum number of retained frames but still do not reach the threshold are discarded to avoid invalid detection results occupying the accumulation queue indefinitely. The preset threshold ranges from 0.5 to 0.8, preferably 0.65. The above threshold can be adjusted according to the accuracy and recall requirements of specific application scenarios. When higher detection accuracy is required, the threshold can be appropriately increased to filter out more uncertain detection results; when higher recall is required, the threshold can be appropriately decreased to retain more potential detection results. The above attenuation coefficient... The value of determines the weight ratio of the current frame detection result in the cumulative fusion confidence. When When set to 0.3, it means that the brand identity detection confidence score of the current frame accounts for 30% of the cumulative fusion confidence score, while the historical cumulative fusion confidence score accounts for 70%. This value is determined based on the temporal proximity characteristic in video stream target detection. The appearance of targets changes little between adjacent frames in consecutive video frames, and the detection results of brand identities have strong temporal continuity. Therefore, historical cumulative information should occupy a higher weight ratio to effectively suppress single-frame detection noise. At the same time, the detection result of the current frame still needs to retain a certain weight ratio to ensure that when the pedestrian's pose changes or the occlusion state changes, the cumulative fusion confidence score can respond promptly to the actual detection situation of the current frame. A value of 0.3 is an optimal balance between detection stability and response timeliness, effectively eliminating false detections in single frames while maintaining sensitivity to changes in target state. In practical applications, this value can be adaptively adjusted based on factors such as the specific frame rate of the store video stream, pedestrian movement speed, and the confidence distribution characteristics of the brand logo detection model. For example, when the video frame rate is high, the target changes less between adjacent frames, so the value can be appropriately reduced. The value is chosen to enhance the smoothing effect of historically accumulated information; when the video frame rate is low, the target changes significantly between adjacent frames, so the value can be appropriately increased. The values are assigned to enhance the impact weight of the detection results in the current frame. Through the aforementioned temporal confidence accumulation and inter-frame confidence weighted fusion, noise and false detections in single-frame detection are effectively eliminated, and the validity of the brand identifier is confirmed based on the accumulated confidence. After confirmation of validity, the system records the brand identifier as a valid detection result. For pedestrians with the same tracked identity, if the same brand identifier is detected again in a subsequent frame and the spatial location is close (intersection over union of detection boxes greater than 0.5), it is not recorded again, but the timestamp of the original record is updated. That is, temporal accumulation to confirm validity is completed first, and then deduplication counting is performed; the two are executed sequentially.
[0040] As a further enhancement to the aforementioned accumulation of temporal confidence, this invention models the detection results of the brand identifier in consecutive frames as a state transition process. Let the brand identifier target be in frame... The detection status is , This indicates that the brand logo was detected in the frame. This indicates that no detection was detected. The state transition exhibits the Markov property, and the state transition probability matrix is defined as: in , This indicates the probability that the brand logo will appear continuously in consecutive frames. This represents the probability of not occurring for an extended period. Based on the state transition model, the brand identity target in the frame... State confidence Confidence is detected from the current frame. Determined jointly with state transition probability: in This is the balance coefficient between the current frame detection result and the state prediction, with a value ranging from 0.3 to 0.7; The initial value is the state confidence score of the previous frame. Set to 0. When When the threshold is exceeded, the brand identifier is confirmed as a valid recognition result. This state transition model utilizes the temporal prior that the brand identifier does not frequently and randomly appear or disappear in consecutive frames, further suppressing the interference of single-frame false detections and missed detections on the recognition results.
[0041] S50 aggregates and statistically analyzes confirmed and valid brand identity recognition results according to preset dimensions to generate a brand distribution analysis report.
[0042] Specifically, the preset dimensions include the overall pedestrian dimension, gender dimension, and age group dimension. The gender dimension is obtained through a pedestrian attribute recognition model, which shares a backbone network with the pedestrian detection model and outputs gender attributes through multi-task learning while detecting pedestrians. The age group dimension is obtained through a pedestrian age estimation model, and age groups can be divided into intervals such as children, youth, middle-aged, and elderly. Statistical indicators include the frequency and percentage of each brand's appearance under each dimension, ultimately generating a statistical report on the brand distribution of pedestrians entering the store.
[0043] In this embodiment, the pedestrian detection model, pedestrian attribute recognition model, and pedestrian re-identification model adopt a hard parameter sharing strategy for multi-task learning. That is, during the training phase, the three tasks share the weights of the same backbone network (CSPDarknet), and their respective task branches (detection head, attribute classification head, and Re-ID feature head) are independent after the backbone network. During the inference phase, only one forward propagation of the backbone network is required to simultaneously obtain the pedestrian detection box, attribute features, and Re-ID features, thereby significantly reducing computational overhead while maintaining accuracy.
[0044] To more comprehensively describe the brand distribution characteristics of the store's customer base, this invention, based on the statistics of brand frequency and proportion, further introduces a brand distribution dispersion index. Let there be a total of... Each brand has a percentage of appearance. ,......, ,satisfy The brand distribution dispersion is defined as: in It is a very small constant. The higher the value, the more dispersed the brand distribution and the more diverse the brand preferences of the customer group; The smaller the value, the more concentrated the brand distribution, and the more focused the customer's brand preference is on a few brands. This dispersion index, together with the statistics on the proportion of each brand, constitutes a complete description of the store's customer brand preferences.
[0045] The dispersion index H-value can be used to assess the concentration of brand preferences among a store's customer base. In actual operation, a low H-value (e.g., less than 0.5) indicates that customer brand preferences are highly concentrated on a few brands, suggesting that stores increase the display and inventory of these brands; a high H-value (e.g., greater than 1.5) indicates that customer brand preferences are diversified, suggesting that stores maintain a balanced multi-brand layout. This index, as a supplement to the percentage statistics, provides a quantitative reference for operational decisions.
[0046] Optionally, based on the above method, inter-frame tracking association can be performed on pedestrian detection boxes in consecutive video frames to assign a unique tracking identity to the same pedestrian. Specifically, based on the intersection-union ratio (IU) of the inter-frame detection boxes and the similarity of the pedestrian's appearance features, the pedestrian detection boxes detected in the current frame are matched and associated with the existing pedestrian detection boxes in the previous frame. For each pedestrian detection box in the current frame, its IU with each pedestrian detection box in the previous frame is calculated, and the matching pair with the largest IU is found. If the IU is greater than a preset threshold, usually set to 0.5, it is determined to be a continuous detection result of the same pedestrian, and the pedestrian detection box is associated with the corresponding pedestrian tracking identity in the previous frame; if there are newly added pedestrian detection boxes in the current frame that have not been associated, a new tracking identity is assigned to them.
[0047] Based on this, the accumulated temporal confidence score is for the brand identification results within the pedestrian detection bounding box area of the same tracked identity. Deduplication is performed based on a pedestrian re-identification algorithm to associate the identity of the same pedestrian in consecutive video frames. The pedestrian re-identification model shares a backbone network with the pedestrian detection model. After the backbone network, the pedestrian re-identification model sequentially connects to a global average pooling layer and a fully connected layer. The global average pooling layer converts the feature map output by the backbone network into a feature vector, and the fully connected layer maps the feature vector to 512 dimensions as the pedestrian's appearance feature vector. Feature vector matching is measured using cosine similarity; when the cosine similarity is greater than a preset threshold of 0.6, the same pedestrian is identified. For confirmed valid brand identification results, deduplication is performed in conjunction with the tracked identity; the same brand identification of the same pedestrian is counted as only one valid sample. Meanwhile, based on the spatial location information of the brand logo within the pedestrian detection box, when the intersection-union ratio (IUU) of multiple detection results exceeds a preset threshold, it is determined to be a duplicate detection of the same brand logo. The preset threshold ranges from 0.3 to 0.7, preferably 0.5. For duplicate detection results, only the detection result with the highest confidence score is retained.
[0048] See Figure 2 , Figure 2 The present invention provides a structural block diagram of a brand identification system, which may include: The video acquisition and pedestrian detection module is used to acquire store video streams, perform pedestrian detection on video frames, and obtain pedestrian detection boxes; The attention feature enhancement module is used to input the image region corresponding to the pedestrian detection box into the brand logo detection and recognition model, and to perform attention enhancement processing on the feature map output by the backbone network of the brand logo detection and recognition model to strengthen the feature response of the brand logo. The brand logo detection and recognition module is used to detect and recognize brand logos in the image area corresponding to the pedestrian detection box, and output the location and category of the brand logo. The time-series confidence accumulation module is used to accumulate the time-series confidence of the detection results of the brand logo, and to confirm the validity of the brand logo based on the accumulated confidence. The aggregation module is used to aggregate and statistically analyze confirmed and valid brand identity recognition results according to preset dimensions, and generate a brand distribution analysis report.
[0049] Correspondingly, this application also provides an electronic device and a computer-readable storage medium, both of which have the corresponding effects of the brand identification method provided in the embodiments of this application. Please refer to... Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0050] An electronic device provided in this application includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the brand identification method described in the above embodiment.
[0051] Please see Figure 4Another electronic device provided in this application embodiment further includes: an input port connected to a processor for transmitting commands input from the outside to the processor; a display unit connected to the processor for displaying the processor's processing results to the outside; and a communication module connected to the processor for enabling communication between the electronic device and the outside. The display unit can be a display panel, a laser scanner, or the like; the communication method used by the communication module includes, but is not limited to, Mobile High-Definition Link (MHL), Universal Serial Bus (USB), High-Definition Multimedia Interface (HDMI), wireless connectivity: Wireless Fidelity (WiFi), Bluetooth communication technology, Bluetooth Low Energy communication technology, and communication technology based on IEEE 802.11s.
[0052] This application provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the steps of the brand identification method described in any of the above embodiments.
[0053] The computer-readable storage media involved in this application include random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs (compact disc read-only memory), or any other form of storage media known in the art.
[0054] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0055] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A brand identification method, characterized in that, include: Obtain the store video stream, perform pedestrian detection on the video frames, and obtain pedestrian detection bounding boxes; The image region corresponding to the pedestrian detection box is input into the brand logo detection and recognition model, and attention enhancement processing is performed on the feature map output by the backbone network of the brand logo detection and recognition model. The attention enhancement processing is used to strengthen the feature response of the brand logo. The brand logo in the image region corresponding to the pedestrian detection box is detected and recognized, and the position and category of the brand logo are output. The detection results of the brand logo are accumulated over time, and the validity of the brand logo is confirmed based on the accumulated confidence score. For confirmed and valid brand identity recognition results, aggregate and statistically analyze them according to preset dimensions to generate a brand distribution analysis report.
2. The brand identification method according to claim 1, characterized in that, The pedestrian detection of video frames is implemented based on a pedestrian detection model, which is constructed based on a single-stage target detection algorithm and uses an anchorless detection mechanism to output pedestrian detection boxes.
3. The brand identification method according to claim 1, characterized in that, The process of inputting the image region corresponding to the pedestrian detection box into the brand logo detection and recognition model includes: scaling the cropped image region to a uniform size before inputting it into the model; the model is constructed based on a single-stage object detection algorithm, using a residual network or a lightweight convolutional network as the backbone network, and performing multi-scale feature fusion through a feature pyramid network; the detection head and classification head of the model share the multi-scale feature maps output by the backbone network and the feature pyramid network, and then pass through independent convolutional branches respectively, the detection head regresses the bounding box offset of the brand logo, and the classification head outputs the category of the brand logo.
4. The brand identification method according to claim 1, characterized in that, The attention enhancement process adaptively weights the feature map through a concatenated channel attention mechanism and a spatial attention mechanism. The channel attention mechanism is used to filter key feature channels that are relevant to brand identification, and the spatial attention mechanism is used to locate the spatial position response area of the brand logo in the feature map.
5. A brand identification method according to claim 4, characterized in that, The channel attention mechanism extracts global semantic information from the feature map through global average pooling and global max pooling, respectively, generates channel weight vectors through a fully connected layer, and multiplies the channel weight vectors element-wise with the original feature map; the spatial attention mechanism performs average pooling and max pooling on the feature map along the channel dimension, generates a spatial weight matrix through a convolutional layer, and multiplies the spatial weight matrix element-wise with the feature map enhanced by channel attention.
6. The brand identification method according to claim 1, characterized in that, The method further includes: performing inter-frame tracking association on pedestrian detection boxes in consecutive video frames, and assigning a unique tracking identity identifier to the same pedestrian; the object of the temporal confidence accumulation is the brand identification result within the pedestrian detection box area of the same tracking identity identifier; for the confirmed valid brand identification result, deduplication is performed in combination with the tracking identity identifier, and the same brand identifier of the same pedestrian is only counted as one valid sample.
7. A brand identification method according to claim 6, characterized in that, The temporal confidence accumulation adopts a sliding window method. For each brand identifier detection target in the current frame, the intersection-union ratio (IUU) of its detection box with the brand identifier detection boxes in the same pedestrian detection box in the previous frame is calculated. If the IUU is greater than a preset threshold, it is determined to be a continuous detection result of the same brand identifier, and the confidence score of the detection result is added to the confidence accumulation queue of the brand identifier target. When the sum of the confidence scores in the accumulation queue exceeds the preset accumulation threshold, the brand identifier target is determined as a valid recognition result and its brand category is output.
8. A brand identification method according to claim 1, characterized in that, The time-series confidence accumulation includes inter-frame confidence weighted fusion; the detection confidence scores output by the brand logo detection and recognition model in multiple consecutive frames are used as input to perform weighted fusion and update the accumulated fusion confidence, which is calculated as follows: in, Accumulate fusion confidence for the current frame. Detect a confidence score for the brand identifier in the current frame. Accumulate the fusion confidence for the previous frame. For the preset attenuation coefficient, ;when When the threshold is exceeded, the brand category of the current frame is output.
9. A brand identification method according to claim 1, characterized in that, The preset dimensions include the dimensions of all pedestrians, gender, and age group; The aggregated statistics are based on a pedestrian attribute recognition model to obtain the pedestrian's gender attribute, and on a pedestrian age estimation model to obtain the pedestrian's age group attribute.
10. A brand identification system for implementing the method as described in any one of claims 1 to 9, characterized in that, include: The system includes a video capture and pedestrian detection module, an attention feature enhancement module, a brand logo detection and recognition module, a temporal confidence accumulation module, and an aggregation module. The video acquisition and pedestrian detection module is used to acquire store video streams, perform pedestrian detection on video frames, and acquire pedestrian detection boxes; The attention feature enhancement module is used to input the image region corresponding to the pedestrian detection box into the brand logo detection and recognition model, and to perform attention enhancement processing on the feature map output by the backbone network of the brand logo detection and recognition model to strengthen the feature response of the brand logo; the brand logo detection and recognition module is used to detect and recognize the brand logo in the image region corresponding to the pedestrian detection box, and output the position and category of the brand logo. The time-series confidence accumulation module is used to accumulate the time-series confidence of the detection results of the brand logo, and to confirm the validity of the brand logo based on the accumulated confidence. The aggregation module is used to aggregate and statistically analyze confirmed and valid brand identification results according to preset dimensions, and generate a brand distribution analysis report.
Citation Information
Patent Citations
Logo detection method based on target detection and metric learning
CN113780284A
A single-stage multi-target tracking method based on attention mechanism
CN117252902B