Trademark infringement detection method and system based on commodity pictures
By segmenting and cutting product images, and using prediction boxes, corner point classes, and block proportions to determine segmentation instructions, trademark patterns can be accurately extracted, solving the problems of accuracy and efficiency in trademark infringement determination, and realizing infringement early warning and monitoring.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN MEIYUNJI NETWORK TECH CO LTD
- Filing Date
- 2026-04-01
- Publication Date
- 2026-05-01
AI Technical Summary
Existing technologies cannot accurately identify trademark patterns in product images when determining trademark infringement, resulting in low accuracy in infringement detection, complex processing procedures, and an inability to provide timely infringement warnings.
By segmenting and cutting product images, segmentation indicators are determined using predicted bounding boxes, corner classes, and block proportions. The SAM2 segmentation algorithm and Harris corner detection algorithm are employed to accurately extract trademark patterns, eliminate interfering factors, and achieve the integrity and feature preservation of trademark patterns.
It enables infringement monitoring during store operations, provides timely infringement warnings, reduces litigation risks, improves the accuracy and efficiency of infringement detection, and reduces workload.
Smart Images

Figure CN121962872A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a trademark infringement detection method and system based on product images. Background Technology
[0002] E-commerce ERP systems are internet-based software systems that manage store operations. They typically process tens of millions of orders daily, resulting in extremely complex data. Therefore, continuously improving the refined management of stores and enhancing operational efficiency are key objectives for e-commerce ERP systems during product upgrades and improvements.
[0003] Throughout the product lifecycle, sellers need to frequently monitor for potential infringement risks, often only becoming aware of such issues after their stores are frozen. In trademark infringement determination scenarios, the similarity between product images and trademark images is typically compared. However, trademark images often occupy only a small portion of product images, resulting in a low overall similarity score. Furthermore, methods that crop product images and compare the similarity between sub-images and trademark images inevitably fragment the trademark image during the cropping process. These methods fail to accurately identify infringing products. Therefore, a more robust trademark infringement detection method is needed that can quickly detect infringement risks in a store and accurately pinpoint specific products.
[0004] Other technical issues related to this application will be further elaborated below. The above content is only for assisting in understanding the technical solutions of this application and does not imply that all of the above content is prior art. Summary of the Invention
[0005] The main objective of this application is to provide a trademark infringement detection method and system based on product images, which can reduce the workload in trademark infringement determination, achieve accurate cropping of minute features in product images, and improve the accuracy of trademark infringement determination.
[0006] To achieve the above objectives, this application proposes a trademark infringement detection method based on product images, the method comprising: Step S1: Obtain the trademark image and retrieve the product image of the product to be tested from the product database; Step S2: Obtain image elements from the product image, wherein the image elements include cutting elements and segmentation elements: Step S21: Determine the segmentation indicator based on the prediction box, the centroid of the corner class, and the block ratio, and input the segmentation indicator into the segmentation algorithm to segment the product image to obtain shape segmentation elements, corner segmentation elements, and block segmentation elements. The prediction box is the smallest bounding rectangle of each graphic in the product image, the corner class is the set of corners obtained after corner detection and classification of the product image, and the block ratio is the ratio of the length and width of the product image to the block ratio. Step S22: Determine the cutting lines of the product image using the prediction box, the class boundary of the corner point class, and the translation block boundary, respectively. Cut the product image based on the cutting lines to obtain shape cutting elements, corner cutting elements, and block cutting elements. The block boundary is the boundary line of each block element after the product image is cut into block elements. Step S3: Classify the image elements and perform redundancy removal on each element class according to element priority; Step S4: Compare the image similarity of the deduplicated image elements with the trademark image. If the image similarity of an image element is greater than the image threshold, it is confirmed that the product to be detected corresponding to the image element infringes on the trademark.
[0007] Other features and technical effects of this application will be described in the latter part of the specification. The technical problem-solving approach and related product design scheme of this application are as follows: The number of TRO (Temporary Restraint Order) cases (where a seller's store is sued for selling infringing products, the court issues an injunction, and the e-commerce platform shuts down the seller's store) is increasing daily. These cases have extremely short processing times, and the costs and difficulties sellers face in responding are high. Therefore, e-commerce ERP systems need to be able to accurately and promptly detect product infringement. However, when determining trademark infringement, since the trademark image only occupies a very small portion of the entire product image, comparing the similarity of the entire image can lead to low accuracy. If the product image is segmented and the similarity of sub-images is compared for trademark infringement determination, the integrity of the trademark image in the image cannot be guaranteed.
[0008] In response, the applicant proposed extracting and separating trademark information from product images before conducting image similarity comparisons to eliminate interference from the products on trademark elements. Due to the excessive types of interfering factors in product images (variable brightness or contrast, complex product backgrounds, millions of images, differences in shooting angles, etc.), target detection cannot accurately identify and extract trademark patterns from product images. Based on this, the applicant proposed using a cutting and segmentation method to crop the product images, converting the numerous and highly interfering product images into a limited number of image elements.
[0009] Based on the segmentation algorithm, by setting different types of segmentation indicators (box hints determined by the bounding box of the predicted box, point hints determined by the centroid of corner points, and line hints corresponding to the segmentation lines of the product image according to the block ratio), the target pattern in the product image is accurately extracted by combining the segmentation algorithm and the segmentation indicators. For box hints, the applicant decomposes common trademark graphics of products, summarizes the annotation rules applicable to most trademark graphics, and determines the predicted box (the smallest bounding rectangle of the graphic) of each graphic based on the annotation rules, ensuring that the box hints of the predicted box can be adapted to most trademarks; for point hints, the applicant proposes to use corner detection to purify some complex trademark patterns and accurately locate the inflection points of complex trademark patterns; for line hints, the applicant noticed that the product in the product image is generally located in the center of the image, and the smaller the cut, the more obvious the element features. Through practice, the applicant found that by dividing the product image into 9 equal parts and cutting the length and width of the product image in a 2:1:2 ratio, the trademark pattern can be ensured to be complete while highlighting the trademark pattern.
[0010] Furthermore, when cutting product images based on cutting lines, compared to equal-part cutting which leads to incomplete trademark patterns, the applicant noted that the predicted frame, as the smallest bounding rectangle of the pattern, can maximize the integrity of the trademark pattern. Therefore, the applicant proposed using the boundary of the predicted frame as the cutting line to obtain shape cutting elements. Also, for complex trademark patterns, corner clustering can preserve pattern details to the greatest extent. Therefore, based on corner clustering, the class boundary of the corner class is determined, and the class boundary is used as the cutting line to obtain corner cutting elements. Additionally, the product image is pre-cut (9-part cutting and proportional cutting). Based on this, combined with the position of the predicted frame and the position of the class boundary, the pre-cutting lines are adaptively moved to ensure the integrity of the trademark pattern and to maximize the preservation of most of the features of the trademark elements, resulting in block cutting elements.
[0011] In summary, this solution reduces the workload of infringement comparison, enables infringement warnings when products are listed for sale, and monitors infringement during store operation. It provides infringement warnings 5 to 10 days before a store is shut down, and identifies specific infringing products, allowing sellers to take timely countermeasures and reduce the risk and probability of triggering infringement lawsuits. Furthermore, this solution eliminates interference from backgrounds, watermarks, and camera angles in product images, adapting to trademark infringement detection for various types of product images. It also enables accurate extraction of minute targets and precise and complete extraction of trademark patterns from product images, improving the accuracy of infringement detection.
[0012] Other implementation schemes and their technical effects will be described later.
[0013] Furthermore, this application also includes systems corresponding to various methods. The trademark infringement detection system includes the functional modules involved in this application, executes operation instructions for the corresponding functional modules or methods, and outputs relevant data information to the system front-end interface. The trademark infringement detection system is stored in a server and / or computer device containing a processor, the processor being used to execute the operation instructions of the trademark infringement detection system.
[0014] Declaration: The functional modules of this application can be integrated with each other, or they can exist independently, or one functional module can be a sub-module of another functional module; the step numbers S1, S2, etc. do not limit the order of the corresponding operation steps. Attached Figure Description
[0015] The accompanying drawings are provided to further understand this application and do not constitute a limitation thereof; the content shown in the drawings may be actual data of the embodiments and falls within the protection scope of this application.
[0016] Figure 1 This is a schematic diagram of the functional modules of an e-commerce ERP system in one embodiment of this application.
[0017] Figure 2 This is a schematic diagram of a trademark infringement detection process based on product images in one embodiment of this application.
[0018] Figure 3 This is a schematic diagram illustrating the principle of trademark infringement detection based on product images in one embodiment of this application.
[0019] Figure 4 This is a schematic diagram of corner clustering in one embodiment of this application. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be further described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0021] refer to Figures 1-4 This application proposes a trademark infringement detection method based on product images. In one embodiment of this application, the trademark infringement detection method based on product images includes steps S1-S4, as follows.
[0022] Step S1: Obtain the trademark image and retrieve the product image of the product to be tested from the product database.
[0023] When sellers on e-commerce platforms sell products using registered trademarks or designs, they may face lawsuits and account freezes. From being sued to having their accounts suspended, only a few days pass, and sellers often only realize their products infringe after the account is closed. Comparing each product image with the trademark is extremely labor-intensive. Therefore, to reduce the workload of trademark infringement detection, this solution extracts trademark images from TRO cases (i.e., trademarks with prior litigation records).
[0024] Step S2: Obtain image elements from the product image, wherein the image elements include cutting elements and segmentation elements: Step S21: Determine the segmentation indicator based on the prediction box, the centroid of the corner class, and the block ratio, and input the segmentation indicator into the segmentation algorithm to segment the product image to obtain shape segmentation elements, corner segmentation elements, and block segmentation elements. The prediction box is the smallest bounding rectangle of each graphic in the product image, the corner class is the set of corners obtained after corner detection and classification of the product image, and the block ratio is the ratio of the length and width of the product image to the block ratio. Step S22: Determine the cutting lines of the product image using the prediction box, the class boundary of the corner point class, and the translation block boundary, respectively. Cut the product image based on the cutting lines to obtain shape cutting elements, corner cutting elements, and block cutting elements. The block boundary is the boundary line of each block element after the product image is cut into block elements.
[0025] The segmentation algorithm is the SAM2 segmentation algorithm. The SAM2 segmentation algorithm supports multimodal input prompts such as bounding boxes, points, and text. It is used to segment the input segmentation prompts and product images, output pixel-level segmentation masks of geometric targets, and calculate the coordinates, horizontal midline, and vertical midline of the geometric targets based on the segmentation masks, and complete pixel-level element cutting. The segmentation indicators include bounding box prompts determined by the bounding box boundaries of the predicted bounding boxes, point prompts determined by the centroid of corner points, and line prompts corresponding to the segmentation lines of the product image according to the block proportions.
[0026] The prediction box data is input into the base model for model training, resulting in a prediction model that takes a product image as input and outputs a product image with a prediction box. The prediction box data includes 13 types of geometric figures and their combinations, as well as annotation rules for each type of figure. The annotation rules are used to determine the minimum bounding rectangle of each type of figure, and the prediction box is the minimum bounding rectangle of each figure in the product image.
[0027] Specifically, prediction box data is input into the base model for model training, resulting in a prediction model that takes a product image as input and outputs a product image with prediction boxes. The prediction box data includes 13 geometric shapes and their combinations, along with annotation rules for each type of shape. These annotation rules determine the minimum bounding rectangle for each type of shape, and the prediction boxes are the minimum bounding rectangles of each shape in the product image. A segmentation algorithm is then used to segment each prediction box, obtaining shape segmentation elements. Specifically, the 13 geometric shapes include triangles, circles, quadrilaterals, polygons, triangles with triangles, triangles with circles, triangles with quadrilaterals, triangles with polygons, circles with circles, circles with quadrilaterals, circles with polygons, quadrilaterals with quadrilaterals, and quadrilaterals with polygons. The annotation rules include a first rule for annotating a single shape, defining the minimum bounding rectangle immediately adjacent to its edge, and a second rule for annotating combined shapes, defining the minimum bounding rectangle containing all elements of the combined shape. The base model can be YOLOv11 (an object detection algorithm). For model training, the prediction box test data can be stratified and divided into training, validation, and test sets in a 7:2:1 ratio. All images are labeled, trained, and classified using the 13 categories mentioned above, outputting product images with prediction boxes. The prediction box is the smallest bounding rectangle of the trademark pattern in the product image. In summary, this yields a scheme for determining the prediction box.
[0028] Corner detection is performed on the product image, and a coordinate system is constructed based on the product image to determine the corner coordinates; clustering calculation is performed on each corner to obtain corner classes, wherein the clustering calculation is to divide each corner into non-overlapping corner classes according to the distance between corners.
[0029] Specifically, the Harris corner detection algorithm is used to calculate the grayscale changes in the pixel neighborhood to detect product images. The image's center pixel is used as the origin (0,0), with the x-axis pointing horizontally to the right and the y-axis pointing vertically upwards. Each corner point corresponds to a unique coordinate (x,y). The k-means clustering algorithm divides the corner points into Q classes based on the Euclidean distance between the coordinates. Q is set according to the actual scenario; in this embodiment, Q=3. Q "cluster centroids" are randomly selected, and each corner point is assigned to the nearest centroid, forming Q classes. The centroid of each class is recalculated, and the above steps are repeated until the centroid no longer changes, thus achieving corner point clustering. In summary, a corner point classification scheme is obtained. In one embodiment, the center and centroid of the corner point class coincide, and the calculation formula is:
[0030] Where Gx is the x-coordinate of the centroid of the corner point class, Gy is the y-coordinate of the centroid, n is the number of corner points in the corner point class, and xi and yi are the x / y coordinates of the i-th corner point in the corner point class. Using the centroid coordinates (Gx, Gy) as a point hint input to SAM2, SAM2 will segment the target region to which the centroid belongs. In another embodiment, after assigning weights to the corner points, the calculation formula is: The x-coordinate of the weighted centroid:
[0031] The y-coordinate of the weighted centroid:
[0032] By giving some corner points (such as the corner point located in the middle of the product image) a greater impact on the center of gravity, and assigning weights to different corner points (for example, the weight of the corner point in the middle of the product image = 2, and the weight of other corner points = 1), the center of gravity is a weighted average, which is different from the center of the corner point class.
[0033] When cutting or segmenting product images, the image can be pre-divided into several parts; in one embodiment, the image is divided into nine equal parts. Based on this, through analysis and summarization of a large amount of product image data and photographic composition knowledge (central composition, rule of thirds), it was found that the main elements in existing product images are concentrated in the center. Therefore, the smaller the cut, the more obvious the element features become. Through analysis, debugging, and testing, it was found that compared to equal division, cutting with a denser middle and wider ends better highlights the features, and the effect is even better when the block ratio is set to a 2:1:2 length-to-width ratio.
[0034] Based on the aforementioned 9-part division and proportional division, the product image is pre-cut into blocks to obtain block elements. The specific values of the block boundaries and the length and width of each block element after division are determined. Object detection is performed on the product image to obtain detection boxes, and the horizontal and vertical centerlines of each detection box are determined. Additionally, based on the above-mentioned method for determining prediction boxes, the prediction boxes of the product image can be determined. The normalized coordinates output by the model are then mapped back to the original image size to determine the coordinates of the prediction boxes, and the horizontal and vertical centerlines of each prediction box are calculated. Based on the above-mentioned corner classification method, after determining the corner classes, the arithmetic mean of the coordinates of all corner points within each corner class is calculated to determine the centroid of each corner class. Calculate the distance L1 (distance between lines) from each block boundary to the center line of the prediction frame or the center line of the detection frame and the distance L2 (distance between a point and a line) to the centroid of the corner point class, and determine whether either L1 or L2 is equal to 0; if so, move the block boundary with a distance of 0 by d, where d takes the value of (0, the width or length of the adjacent block boundary perpendicular to the block boundary with a distance of 0 / 100). In one embodiment, let the length (parallel to the y-axis) of the block element be j, and the width (parallel to the x-axis) be k. When either L1 or L2 corresponding to the vertical boundary x=a of the block element is 0, the adjacent block boundary perpendicular to the block boundary with a distance of 0 has a width of k, and a random number d is generated in (0, k / 100] to adjust the vertical boundary to x=a+d or x=a−d; similarly, when either L1 or L2 corresponding to the horizontal boundary y=b of the block element is 0, the adjacent block boundary perpendicular to the block boundary with a distance of 0 has a width of k, and a random number d is generated in (0, k / 100] to adjust the vertical boundary to x=a+d or x=a−d; similarly, when either L1 or L2 corresponding to the horizontal boundary y=b of the block element is 0, the adjacent block boundary perpendicular to the block boundary with a distance of 0 has a width of k, and a random number d is generated in (0, k / 100] to adjust the vertical boundary to x=a+d or x=a−d; The adjacent block boundary is of length j. A random number d is generated in (0, j / 100], and the horizontal boundary is adjusted to y=b+d or y=b−d. After adjustment, it must be ensured that the block boundary does not exceed the image range, and L1 and L2 are recalculated to ensure that the block boundary no longer presses on the center line or center of gravity. When L1 and L2 are not equal to 0, the product image is cut according to the boundary of each block element to obtain the block cut elements. In summary, the scheme of moving the block boundary can ensure that there is a block element that retains most of the features of the trademark element, and by fine-tuning to change the pressing line situation that occurs during the cutting, the overall pattern of dividing the product image into 9 parts is not changed. This scheme does not restrict the direction of block boundary movement. In one embodiment, the direction of the block boundary with a distance of 0 (horizontal or vertical) is determined, and the direction of block boundary movement is determined to be different from the direction of block boundary. For example, if the direction of block boundary is vertical, the block boundary is controlled to move left and right in the horizontal direction.
[0035] After determining the prediction bounding boxes for the product image based on the above prediction bounding box determination scheme, the prediction bounding boxes are segmented using a segmentation algorithm to obtain shape segmentation elements. The average value of the coordinates of all corner points within a corner point class is calculated to obtain the centroid of each corner point class; the centroid is used as the target point of the segmentation algorithm, and the product image is segmented using the target point to obtain corner point segmentation elements.
[0036] Based on the above corner classification scheme, corner classes are obtained, and the boundary corners of each corner class are acquired. The boundary corners are the farthest corners in the four directions of the coordinate system. The class boundaries of each corner class are constructed based on the boundary corners, and the product image is cut based on the class boundaries to obtain corner cutting elements. Alternatively, the prediction box of the product image is determined based on the above prediction box determination scheme, and the product image is cut based on the prediction box to obtain shape cutting elements. Specifically, based on the extreme values (leftmost, rightmost, topmost, and bottommost) of each corner point in each corner point class in the four directions of the coordinate axis, the four boundary corner points of each corner point class are determined. The class boundary is the smallest rectangle that exactly surrounds all corner points of the class. The two opposite corners of the rectangle can be determined by the extreme coordinates of the boundary corner points. For example, the coordinates of the top left corner of the class boundary are (Xmin, Ymin), which is the x of the left boundary corner point plus the y of the top boundary corner point. The coordinates of the bottom right corner of the class boundary are (Xmax, Ymax), which is the x of the right boundary corner point plus the y of the bottom boundary corner point. The area from Xmin to Xmax and from Ymin to Ymax in the product image is then cut out.
[0037] Step S3: Classify the image elements and perform redundancy removal on each element class according to element priority.
[0038] The redundancy removal process involves calculating the Euclidean distance for all image elements, categorizing image elements with high similarity, and setting an element threshold based on business needs (in one embodiment, the element threshold is 95). One image element is retained from each category. Since cutting and segmentation may result in duplicate data, directly comparing a large number of image elements with trademark images would require infringement determination. Therefore, the redundancy removal process effectively reduces the number of image elements, decreases the workload of infringement comparison, and improves the efficiency of product infringement detection. Specifically, the element categorization involves vectorizing each image element to obtain its feature vector. The element similarity between any two image elements is calculated based on the feature vector, and image elements with similarity greater than the element threshold are categorized. It can be understood that the image element in this solution can be an image or its corresponding feature vector. Image elements in each element category are sorted according to element priority, and the image element with the highest priority in each element category is retained. Redundancy removal is performed on the remaining elements in each element category, resulting in M cutting elements and N segmentation elements. Furthermore, M and N are both positive integers.
[0039] In one embodiment, when the number of element classes is too small, retaining only one image element from each element class will result in too few image elements after deduplication, thus reducing the accuracy of infringement detection. Therefore, to ensure that the values of M and N achieve the best infringement detection effect, two or more elements are retained in each type of image element. The applicant noted that when M is 3 and N is 8, the best infringement detection effect is achieved, and the detection workload is reduced. It is understandable that the segmented elements obtained after the segmentation algorithm can eliminate interference from irrelevant factors. Compared to directly cutting the product image—retaining more image background—the image background of the segmented elements is cleaner, with less background. Therefore, the priority of segmented elements is greater than that of cut elements. Furthermore, shape segmentation (or shape cutting) generally covers a larger area and has better feature extraction effects than corner segmentation (corner cutting). Moreover, block segmentation (or block cutting) has a probability of cropping trademark elements, thus having a lower priority. The element priority is: shape segmentation element > corner segmentation element > block segmentation element > shape cutting element > corner cutting element > block cutting element.
[0040] Step S4: Compare the image similarity of the deduplicated image elements with the trademark image. If the image similarity of an image element is greater than the image threshold, it is confirmed that the product to be detected corresponding to the image element infringes on the trademark.
[0041] Iterate through the image elements and calculate the Euclidean distance between each image element and the trademark image to determine the image similarity between the image elements and the trademark images. When the image similarity of an image element is greater than a threshold, it is confirmed that the product to be detected corresponding to the image element infringes on the trademark.
[0042] In one embodiment, image similarity can be determined by calculating the Euclidean distance. Image elements in image form are converted into low-dimensional, representative feature vectors. Let the feature vector of image element A be VA=(a1,a2,...,an), and the feature vector of image element B be VB=(b1,b2,...,bn). Then the Euclidean distance between them is:
[0043] The smaller the Euclidean distance, the closer the confirmed features, and the higher the similarity of image elements. When classifying image elements, similarity can be directly compared, or a clustering algorithm can be used to select feature vectors to determine the images of the same class with the highest similarity.
[0044] In one embodiment, when it is confirmed that a product infringes on a trademark, the infringing product is displayed on a detection interface. The detection interface includes product information (the store's location, store name, and product code of the infringing product), product infringement information (descriptions of products similar to the trademark and / or product images), and trademark information (trademark images and / or trademark names).
[0045] In addition, for textual portions of the product (product description, product name, etc.), the trademark name and text extracted from the trademark image are compared with the textual portions of the product to determine whether trademark infringement exists. Understandably, this solution also applies to other types of infringement, such as copyright infringement and design infringement.
[0046] In summary, the above solution reduces the workload of infringement comparison, enables infringement warnings when products are listed for sale, and monitors infringement during store operation. It provides infringement warnings 5 to 10 days before a store is shut down, and identifies specific infringing products, allowing sellers to take timely countermeasures and reduce the risk and probability of triggering infringement lawsuits. Furthermore, this solution eliminates interference from backgrounds, watermarks, and camera angles in product images, enabling accurate extraction of trademark patterns from product images, adapting to the unique characteristics of product images. Moreover, this solution can identify minute targets in product images, eliminate irrelevant factors, and completely extract trademark patterns, achieving complete and accurate extraction of specific image features.
[0047] The above description is merely a preferred embodiment of this application and does not limit the patent scope of this application. All equivalent modifications made based on the inventive concept of this application and the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included within the patent protection scope of this application.
Claims
1. A trademark infringement detection method based on product images, characterized in that, Applied to e-commerce ERP systems, including: Step S1: Obtain the trademark image and retrieve the product image of the product to be tested from the product database; Step S2: Obtain image elements from the product image, wherein the image elements include cutting elements and segmentation elements: Step S21: Determine the segmentation indicator based on the prediction box, the centroid of the corner class, and the block ratio, and input the segmentation indicator into the segmentation algorithm to segment the product image to obtain shape segmentation elements, corner segmentation elements, and block segmentation elements. The prediction box is the smallest bounding rectangle of each graphic in the product image, the corner class is the set of corners obtained after corner detection and classification of the product image, and the block ratio is the ratio of the length and width of the product image to the block ratio. Step S22: Determine the cutting lines of the product image using the prediction box, the class boundary of the corner point class, and the translation block boundary, respectively. Cut the product image based on the cutting lines to obtain shape cutting elements, corner cutting elements, and block cutting elements. The block boundary is the boundary line of each block element after the product image is cut into block elements. Step S3: Classify the image elements and perform redundancy removal on each element class according to element priority; Step S4: Compare the image similarity of the deduplicated image elements with the trademark image. If the image similarity of an image element is greater than the image threshold, it is confirmed that the product to be detected corresponding to the image element infringes on the trademark.
2. The method as described in claim 1, characterized in that, The prediction box data is input into the base model for model training to obtain a prediction model with product images as input and product images with prediction boxes as output. The prediction box data includes 13 types of geometric figures and their combinations, as well as the annotation rules for each type of figure. The annotation rules are used to determine the minimum bounding rectangle of each type of figure. Corner detection is performed on the product image, and a coordinate system is constructed based on the product image to determine the corner coordinates; clustering calculation is performed on each corner to obtain corner classes, wherein the clustering calculation is to divide each corner into non-overlapping corner classes according to the distance between corners.
3. The method as described in claim 2, characterized in that, Step S22 also includes: The product image is pre-cut into blocks to obtain block elements, and the block boundaries and length and width values of each block element are determined. The pre-cutting of blocks includes cutting into 9 equal parts and cutting according to the block ratio. Calculate the horizontal and vertical midlines of the prediction box and determine the centroid of each corner point class; Calculate the distance L1 from each block boundary to the center line and the distance L2 to the centroid, and determine whether either L1 or L2 is equal to 0; If so, the block boundary with a distance of 0 is moved by d, where d is (0, the width or length of the adjacent block boundary perpendicular to the block boundary with a distance of 0 / 100); when L1 and L2 are not equal to 0, the product image is cut according to the block boundary of each block element to obtain the block cutting elements.
4. The method as described in claim 2, characterized in that, Step S21 also includes: The predicted bounding boxes in the product image are segmented using a segmentation algorithm to obtain shape segmentation elements; Alternatively, calculate the average coordinates of all corner points within a corner point class to obtain the centroid of each corner point class; use the centroid as a point cue for the segmentation algorithm and segment the product image to obtain corner point segmentation elements.
5. The method as described in claim 2, characterized in that, Step S21 also includes: The product image is segmented by using blocks that are dense in the middle and wide at both ends, with the block ratio being 2:1:2 (length:width ratio). Each block is then segmented using a segmentation algorithm to obtain block segmentation elements.
6. The method as described in claim 2, characterized in that, Step S22 also includes: Obtain the boundary corner points of each corner point class, where the boundary corner point is the farthest corner point in the four directions of the coordinate system; construct the class boundary of each corner point class based on the boundary corner points; and cut the product image based on the class boundary to obtain corner point cutting elements. Alternatively, the product image can be segmented based on the predicted bounding box to obtain shape segmentation elements.
7. The method as described in claim 1, characterized in that, Step S3 also includes: Each image element is vectorized to obtain its feature vector. Calculate the element similarity between any two image elements based on feature vectors, and classify image elements whose element similarity is greater than the element threshold. The image elements in each element class are sorted according to their element priority, and the image element with the highest priority in each element class is retained. The remaining elements in the element class are deredundant to obtain M cutting elements and N segmentation elements. The element priority is as follows: shape segmentation element > corner segmentation element > block segmentation element > shape cutting element > corner cutting element > block cutting element.
8. The method as described in claim 1, characterized in that, The segmentation algorithm is the SAM2 segmentation algorithm, and the segmentation indicators include box hints determined by the bounding box boundaries of the predicted box, point hints determined by the centroid of the corner point class, and line hints corresponding to the segmentation lines of the product image based on the block proportions.
9. The method as described in claim 1, characterized in that, Step S4 also includes: Iterate through the element images and calculate the Euclidean distance between each image element and the trademark image to determine the image similarity between the image elements and the trademark images; If the image similarity of an image element is greater than the image threshold, it is confirmed that the product to be detected corresponding to the image element infringes on trademarks.
10. A trademark infringement detection system based on product images, characterized in that, The trademark infringement detection system executes the operation instructions contained in the trademark infringement detection method based on product images as described in any one of claims 1-9.
Citation Information
Patent Citations
Image segmentation method and device based on SAM (Segmentation All Model)
CN120219398A
Infringement commodity detection method and device, equipment and medium
CN120450828A