A method and device for constructing a dataset of systematic color SVG icons

By adopting a systematic method for constructing color SVG datasets, the shortcomings of existing SVG datasets in terms of color and format are addressed, resulting in high-quality and diverse color SVG datasets. This improves the reliability and usability of the datasets and supports complex algorithms and graphic design.

CN120011319BActive Publication Date: 2026-01-02SUN YAT SEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411860257.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2026-01-02
Estimated Expiration
2044-12-17

AI Technical Summary

Technical Problem

Existing SVG datasets suffer from problems such as the lack of color SVGs in black and white SVGs, the limitation of raster icon formats in practical applications, and insufficient data cleaning and standardization, resulting in inadequate color information processing and consistency in the datasets.

Method used

A high-quality color SVG dataset is constructed using a systematic approach that includes data collection, data cleaning, bounding box standardization, classification, and partitioning of training, validation, and test sets. The CLIP model is then used for image and text feature matching to ensure classification accuracy.

Benefits of technology

It improves the quality and consistency of color SVG datasets, supports the development and training of complex algorithms, enhances the capabilities of graphic design software, and improves data visualization techniques.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120011319B_ABST
    Figure CN120011319B_ABST
Patent Text Reader

Abstract

The application discloses a systematic color SVG icon dataset construction method and device, and the method comprises the following steps: collecting SVG files, and performing data cleaning on the collected SVG files to obtain initial files; wherein the SVG files comprise SVG icons of different categories, and the initial files are color SVG files; performing standardization processing on the boundary box size of the initial files to obtain sample files; classifying the sample files, and dividing training set, verification set and test set according to the classified sample files to obtain SVG datasets. The application can improve the construction quality of color SVG datasets.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of computer graphics, and particularly relates to a systematic color SVG icon dataset construction method and device. BACKGROUND

[0002] Currently, there are some SVG-related datasets, such as SVG-Icons8 dataset, FIGR-8-SVG dataset, and Icon645 dataset. The following is a detailed description of these datasets and their construction processes:

[0003] (1) SVG-Icons8 dataset: During the writing process, the author ensures the consistency and diversity of SVG by ensuring that SVG graphics have similar proportions, colors, and styles, while capturing different real-world graphics. Finally, the dataset consists of 100,000 SVGs from 56 different categories.

[0004] (2) FIGR-8-SVG dataset: The SVGs in this dataset are black-and-white representations of objects, concepts, patterns, or designs, created by designers and artists and compiled into a dataset. There are 1,548,944 SVGs in the dataset, which are divided into 18,409 conceptually different categories, each containing at least 8 SVGs and up to several thousand.

[0005] (3) Icon645 dataset: This dataset is retrieved and collected from the Flaticon website, building an icon dataset containing 377 categories, with 645,687 color icons. During the dataset construction process, the author cropped the white space of each icon graphic in the dataset to make it more compact, and filtered out black-and-white icons, removing redundant instances based on graphic similarity.

[0006] Although the above datasets have contributed in their respective fields, there are still some problems and shortcomings:

[0007] (1) Limitations of black-and-white SVG: SVG-Icons8 and FIGR-8-SVG datasets are mainly composed of black-and-white SVGs, lacking color SVGs, which is not sufficient when dealing with application scenarios that require rich color information.

[0008] (2) Format problem of raster icons: Although the Icon645 dataset contains color icons, these icons are stored in raster graphics format, not SVG format. This limits the practical application value of the dataset in applications that require vector graphics.

[0009] (3) Data cleaning and standardization are insufficient: Although some data sets have undergone preliminary data cleaning and arrangement, there are still deficiencies. For example, the sizes of icons in the Icon645 data set are not uniform, ranging from the smallest 64x64 to the largest 256x256, resulting in problems of precision and consistency of the data set. At the same time, the collected data may be biased, that is, the categories corresponding to the icons are not their true categories. SUMMARY

[0010] The present application provides a systematic color SVG icon dataset construction method and device to overcome the above-mentioned defects of the prior art, which can improve the construction quality of color SVG dataset.

[0011] An embodiment of the present application provides a systematic color SVG icon dataset construction method, comprising the following steps:

[0012] Collect SVG files and clean the collected SVG files to obtain initial files; wherein the SVG files include a plurality of SVG icons of different categories, and the initial files are color SVG files;

[0013] Standardize the size of the boundary box of the initial file to obtain a sample file;

[0014] Classify the sample file, and divide the training set, validation set and test set according to the classified sample file to obtain the SVG dataset.

[0015] Further, the collecting SVG files specifically includes:

[0016] Filter and expand the icon categories in the Icon645 dataset to obtain a plurality of collection categories;

[0017] Collect SVG icons of different collection categories from open source platforms, and label all SVG icons with corresponding category labels to obtain SVG files.

[0018] Further, the cleaning the collected SVG files to obtain initial files specifically includes:

[0019] Confirm the attributes of the SVG files respectively, remove SVG files lacking preset fill attributes, and rasterize the remaining SVG files respectively to obtain corresponding bitmap images;

[0020] Determine the pixel value of each pixel in the bitmap image respectively, and calculate the proportion of pixels with a pixel value of 0 in the bitmap image in all pixels;

[0021] remove the bitmap image corresponding to the proportion of 0 and the proportion of more than the preset proportion threshold, and determine the SVG file corresponding to the remaining bitmap image as the initial file.

[0022] Further, the boundary box size of the initial file is standardized to obtain a sample file, specifically including:

[0023] The boundary box size of all initial files is uniformly adjusted to a preset boundary box threshold to obtain the sample file.

[0024] Preferably, before the initial file is standardized, it further includes:

[0025] The initial file is divided into a plurality of sub-images, and the boundary box size of each sub-image is standardized. <g>The attributes of the tag are transferred to the <g>After the sub-nodes of the tag, remove the said <g>Label.

[0026] Further, the sample file is classified, specifically comprising:

[0027] The sample file is rasterized to obtain a grid image;

[0028] All the grid images are input into the image encoder of the preset CLIP model to obtain image features, and all the category labels are input into the text encoder of the preset CLIP model to obtain text features;

[0029] For each image feature, the similarity between the image feature and each text feature is calculated respectively, and the category label corresponding to the text feature with the highest corresponding similarity is determined as the correct category of the sample file corresponding to the image feature;

[0030] The number of grid images in each correct category is counted, and the top a correct categories with the highest number of grid images are taken as the dataset categories; wherein a is a preset ranking threshold;

[0031] According to the dataset categories, all the grid images are reclassified by the preset CLIP model, and the confidence between the reclassified grid images and the corresponding categories is calculated, and the grid images with a confidence lower than a preset confidence threshold are removed, to complete the classification.

[0032] Further, the sample file is classified, specifically comprising:

[0033] According to the preset training set number, the validation set number and the test set number, the classified sample files are divided by stratified sampling to obtain the SVG dataset.

[0034] Another embodiment of the application provides a system color SVG icon dataset construction device, comprising: an acquisition module, a standardization module and a classification module;

[0035] The acquisition module is used for acquiring SVG files and performing data cleaning on the acquired SVG files to obtain initial files; wherein the SVG files include a plurality of SVG icons of different categories, and the initial files are color SVG files;

[0036] The standardization module is used for standardizing the size of the boundary box of the initial file to obtain a sample file;

[0037] The classification module is used for classifying the sample file and dividing training set, validation set and test set according to the classified sample file to obtain an SVG dataset.

[0038] Further, the collection module is used for collecting SVG files, and specifically includes:

[0039] The icon categories in the Icon645 dataset are filtered and expanded to obtain a plurality of collection categories.

[0040] SVG icons of different collection categories are collected from an open source platform, and all the SVG icons are labeled with corresponding category labels to obtain SVG files.

[0041] Further, the standardization module is used for standardizing the size of the bounding box of the initial file to obtain a sample file, and specifically includes:

[0042] The size of the bounding box of all the initial files is uniformly adjusted to a preset bounding box threshold to obtain the sample file.

[0043] Compared with the prior art, the beneficial effects of the present application are that:

[0044] Through strict data cleaning and standardization steps, the quality and consistency of the SVG files are improved, so that the dataset is more reliable in actual application. At the same time, the data cleaning step also ensures that the final obtained dataset covers rich color SVG graphics, supports the development and training of complex algorithms, enhances the ability of graphic design software, and improves the data visualization technology.

[0045] In summary, through the technical solution provided by the present application, a high-quality, rich and diverse color SVG dataset can be provided for researchers and developers, which promotes the technological progress and innovation in related fields. BRIEF DESCRIPTION OF DRAWINGS

[0046] Figure 1 A flowchart of a systematic color SVG icon dataset construction method provided by an embodiment of the present application.

[0047] Figure 2 A statistical diagram of the number of samples corresponding to each category in the training set of the ColorSVG-100K dataset provided by an embodiment of the present application.

[0048] Figure 3 A statistical diagram of the average path number corresponding to each category in the training set of the ColorSVG-100K dataset provided by an embodiment of the present application.

[0049] Figure 4 A part of sample diagrams of the ColorSVG-100K dataset provided by an embodiment of the present application.

[0050] Figure 5 A structural schematic diagram of a systematized color SVG icon dataset construction device is provided for another embodiment of the present application. DETAILED DESCRIPTION

[0051] The accompanying drawings are only intended to be illustrative and should not be construed as limiting the patent;

[0052] It is understandable for those skilled in the art that some well-known structures and their descriptions in the drawings can be omitted.

[0053] The technical solutions of the present application will be further described below in combination with the drawings and embodiments.

[0054] Reference Figure 1 A flowchart of a systematized color SVG icon dataset construction method is provided for an embodiment of the present application, including the following steps:

[0055] S1: Collect SVG files and perform data cleaning on the collected SVG files to obtain initial files; wherein the SVG files include a plurality of SVG icons of different categories, and the initial files are color SVG files;

[0056] S2: Standardize the size of the boundary box of the initial file to obtain a sample file;

[0057] S3: Classify the sample file and divide the training set, validation set and test set according to the classified sample file to obtain the SVG dataset.

[0058] For step S1, specifically, the collection of SVG files specifically includes:

[0059] The icon categories in the Icon645 dataset are filtered and expanded to obtain a plurality of collection categories;

[0060] SVG icons of different collection categories are collected from open source platforms respectively, and all the SVG icons are labeled with corresponding category labels to obtain SVG files.

[0061] In a preferred embodiment, the first step in constructing the color SVG dataset is data collection. This process involves obtaining a large number of SVG files from various online repositories and open source platforms, with the goal of covering graphics of different styles, themes, and complexity levels. Diversity is crucial to ensure that a comprehensive dataset can support a wide range of research and application needs.

[0062] On this basis, the preferred embodiment further screens and expands based on the categories in the Icon645 dataset to identify common categories as the collection categories. Subsequently, SVG files are collected and downloaded from the network according to the collection categories. At this stage, the collected SVG files are relatively extensive and relatively raw, with uneven quality.

[0063] For step S1, further, the collected SVG files are subjected to data cleaning to obtain initial files, specifically including:

[0064] The SVG files are subjected to attribute confirmation respectively, the SVG files lacking the preset fill attribute are removed, and the remaining SVG files are respectively rasterized to obtain corresponding bitmap images;

[0065] The pixel values of each pixel in the bitmap image are determined respectively, and the proportion of pixels with a pixel value of 0 in all pixels in the bitmap image is calculated;

[0066] The bitmap images corresponding to the proportions of 0 and the proportions exceeding the preset proportion threshold are removed, and the SVG files corresponding to the remaining bitmap images are determined as the initial files.

[0067] In one preferred embodiment, after data collection is completed, the dataset will undergo a rigorous cleaning process to ensure its quality and consistency. This step is crucial because it can remove any damaged, incomplete or low-quality SVG files that may negatively affect the performance of the algorithm. The initially collected data often contains duplicates and colorless SVGs, which are contrary to the core goal of the final required SVG dataset. Therefore, these duplicates and colorless SVGs, as well as any damaged or incomplete files, need to be removed first to ensure the reliability of the dataset in subsequent processing and analysis. The specific process of data cleaning is as follows:

[0068] First, check whether each SVG file lacks the "fill" attribute (i.e., the preset fill attribute). If the "fill" attribute is not included in the SVG file, it can be initially judged that it is an SVG containing only black. This type of file will usually be rendered in default black, so it will be removed. In this process, the preferred embodiment temporarily ignores other possible filling methods.

[0069] Next, rasterize the SVG file to convert it into a bitmap image, and check whether the image is only black (value 0) and white (value 255). If this condition is met, the SVG will be deleted.

[0070] In addition, to improve the quality of the dataset, it is also necessary to remove SVG files that are predominantly black. To do this, it is necessary to evaluate the proportion of black pixels to other colored pixels (excluding white background), and if the proportion of black pixels exceeds that of other colored pixels (excluding white background), the corresponding SVG will also be removed.

[0071] Thus, the data cleaning step is completed, and the initial file is obtained. Such a cleaning process is crucial for improving the overall quality and consistency of the dataset.

[0072] For step S2, specifically, the bounding box size of the initial file is standardized to obtain a sample file, specifically including:

[0073] Adjusting the size of the bounding box of all initial files to a preset threshold to obtain the sample file.

[0074] In a preferred embodiment, data standardization is an important step to ensure the consistency of the dataset. The bounding box (Bbox) is used to define the spatial range of graphics in SVG, providing key information for positioning and scaling in various applications. However, the collected SVG bounding boxes have inconsistencies in size and position, which may increase the complexity of subsequent processing and analysis.

[0075] To solve this problem, the preferred embodiment unifies all bounding boxes to a size of 100x100 units. This process involves adjusting the size and position of the SVG to adapt to the standardized bounding box. Through this standardization operation, it can be ensured that all SVGs follow a unified spatial framework, making them more reliable and consistent in different research and application backgrounds. This not only simplifies the processing and operation of graphics, but also promotes more accurate algorithm training.

[0076] For step S2, preferably, before standardizing the initial file, it also includes:

[0077] In the initial file <g>The attributes of the tag are transferred to the <g>After the sub-nodes of the tag, remove the said <g>Label.

[0078] In a preferred embodiment, <g>Tags are used in SVG to group multiple elements, but this increases the processing and manipulation complexity of a single graphical component. As a result of these <g>The tag typically carries information in which <path>The attributes of the elements, therefore, cannot simply be deleted directly from these tags, but instead need to be removed <g>The attributes in the label are transferred to the child node and then removed.

[0079] In addition, the preferred embodiment also uses the svglib library provided by DeepSVG and further optimizes it to remove the <g>The parts of the label, eventually generating a flattened path combination. By this way the removal <g>The tags can simplify the structure of SVGs, making them more accessible and easier to process in various computational tasks, while preserving the integrity of the graphics.

[0080] For step S3, specifically, the classification of the sample files specifically includes:

[0081] Grid the sample files to obtain grid images;

[0082] Input all the grid images into the image encoder of the preset CLIP model to obtain image features, and input all the category labels into the text encoder of the preset CLIP model to obtain text features;

[0083] For each image feature, the similarity between the image feature and each text feature is calculated, and the category label corresponding to the text feature with the highest corresponding similarity is determined as the correct category of the sample file corresponding to the image feature;

[0084] Count the number of grid images in each correct category, and select the top a correct categories with the highest number of grid images as the dataset categories; wherein a is a preset ranking threshold;

[0085] According to the dataset categories, reclassify all the grid images through the preset CLIP model, calculate the confidence between the reclassified grid images and the corresponding categories, remove the grid images with a confidence lower than the preset confidence threshold, and complete the classification.

[0086] In a preferred embodiment, the initially collected SVG files may have classification errors, i.e., the graphics do not match the assigned categories. Therefore, to ensure the accurate classification of SVGs, reclassification is necessary.

[0087] First, we grid the SVGs to obtain the grid images and use the CLIP model to assist in reclassification. These grid images will be input into the CLIP image encoder, while the category labels will be input into the CLIP text encoder. By calculating the similarity between the generated features, the highest scoring match is output as the label, thus determining the correct category of each SVG.

[0088] Then, count the number of SVGs in each category and arrange these categories in descending order, and finally select the top 500 categories with the most number as the classification standard of the dataset, i.e., the dataset categories.

[0089] Finally, based on the 500 dataset categories, all the grid images were classified, and those SVGs with low confidence scores and inconsistent with their original categories in model classification were removed from the dataset. At the same time, the same method was used to correct the SVGs with high confidence but incorrect classification. Finally, in the preferred embodiment, the total number of SVGs after classification was 100,000.

[0090] For step S3, further, the SVG dataset is obtained by dividing the classified sample files into a training set, a validation set, and a test set, specifically including:

[0091] According to the preset number of training sets, the number of validation sets, and the number of test sets, the classified sample files are divided by stratified sampling to obtain the SVG dataset.

[0092] In a preferred embodiment, the last step of building the dataset is to divide it into a training set, a validation set, and a test set. Considering that the SVG or image generation model may take a long time in the generation process, 8,000 samples are finally allocated for the validation set and 2,000 samples are allocated for the test set.

[0093] To ensure the balanced distribution of categories and visual features, the preferred embodiment uses stratified sampling method to divide the original 100,000 SVG dataset. This method ensures that each subset accurately represents the diversity of the overall dataset.

[0094] Therefore, the final training set contains 90,000 SVGs, the validation set contains 8,000 SVGs, and the test set contains 2,000 SVGs.

[0095] Through the above systematic color SVG icon dataset construction method, the ColorSVG-100K dataset is constructed in the embodiment of the application, and the following is a statistical analysis of the ColorSVG-100K dataset:

[0096] First, in the training set, the SVG samples are classified according to their respective categories, and the number of samples in each category is counted. The results are arranged in descending order, and the intermediate results are omitted for simplicity, as shown in Figure 2 It can be seen from Figure 2 that the category with the most samples contains as many as 475 instances, while the category with the fewest samples contains about 40 instances. This imbalance in the dataset is due to the uneven distribution of different SVG categories on online resources, with more samples for common categories and fewer samples for rare categories.

[0097] In addition, the average number of paths for each class in the training set was analyzed to assess the complexity of different classes. The results of this analysis are arranged in descending order, with intermediate results omitted for brevity, as shown in Figure 3 Figure 3 It can be seen that the class with the most average number of paths is "basket", followed by "lion", indicating that these classes have more complex designs and contain more lines. Therefore, they are more complex. In contrast, the classes with the fewest average number of paths are "arrow" and "bookmark", indicating that these SVGs are less complex.

[0098] The numerical statistics of different dimensions (classes) in each subset of the SVG dataset are shown in the following table:

[0099]

[0100] Finally, referring to Figure 4 , a part of the ColorSVG-100K dataset provided by an embodiment of the present application is shown in the following figure. Figure 4 In the above figure, 20 classes were randomly selected from the dataset, and 3 SVG samples were randomly selected from each class. By observing these samples, it can be seen that the systematic construction method of the color SVG icon dataset provided by the present application effectively guarantees the diversity of the dataset, and the quality of the SVGs is high, fully embodying the superior effects of the present method.

[0101] In summary, the embodiment of the present application significantly improves the quality and practicality of the SVG dataset through a systematic construction method. The specific effects and advantages include:

[0102] (1) Improved dataset quality: Through strict data cleaning and standardization steps, the quality and consistency of SVG files are improved, making the dataset more reliable in practical applications.

[0103] (2) Improved data processing efficiency: Simplified SVG structure and unified bounding box standardization make data processing and model training more efficient.

[0104] (3) Enhanced class accuracy: The reclassification method of the CLIP model ensures accurate classification of SVGs and reduces classification errors.

[0105] (4) Improved practicality of the dataset: It covers a wide range of color SVG graphics, supports the development and training of complex algorithms, enhances the capabilities of graphic design software, and improves data visualization techniques.

[0106] Referring to Figure 5 ​A structural schematic diagram of a systematized color SVG icon dataset construction device according to another embodiment of the present application, comprising: an acquisition module 101, a standardization module 102 and a classification module 103;

[0107] The acquisition module 101 is configured to acquire SVG files and clean up the acquired SVG files to obtain initial files; wherein the SVG files comprise SVG icons of different categories, and the initial files are color SVG files.

[0108] The standardization module 102 is configured to standardize the size of the boundary box of the initial files to obtain sample files.

[0109] The classification module 103 is configured to classify the sample files and divide training sets, validation sets and test sets according to the classified sample files to obtain SVG datasets.

[0110] Further, the acquisition module 101 is configured to acquire SVG files, specifically comprising:

[0111] Filtering and expanding the icon categories in the Icon645 dataset to obtain several acquisition categories;

[0112] Acquiring SVG icons of different acquisition categories from an open source platform, and labeling all the SVG icons with corresponding category labels to obtain SVG files.

[0113] Further, the standardization module 102 is configured to standardize the size of the boundary box of the initial files to obtain sample files, specifically comprising:

[0114] Uniformly adjusting the size of the boundary box of all the initial files to a preset boundary box threshold to obtain the sample files.

[0115] Obviously, the above embodiments of the present application are only examples for clearly illustrating the present application, and are not intended to limit the embodiments of the present application. For those skilled in the art, other different forms of changes or modifications can be made on the basis of the above description. Here, it is not necessary and impossible to exhaust all the embodiments. Any modification, equivalent replacement and improvement made within the spirit and principle of the present application shall be included in the protection scope of the claims of the present application.< / g> < / g> < / g> < / path> < / g> < / g> < / g> < / g> < / g> < / g> < / g> < / g>

Claims

1. A method for constructing a dataset of systematized color SVG icons, characterized by, Comprising the following steps: Collecting an SVG file and performing data cleaning on the collected SVG file to obtain an initial file; wherein the SVG file includes a plurality of SVG icons of different categories, and the initial file is a color SVG file; the collecting of the SVG file specifically includes: Filtering and expanding the icon categories in the Icon645 dataset to obtain a plurality of collection categories; Collecting SVG icons of different collection categories from an open source platform, and labeling all the SVG icons with corresponding category labels to obtain an SVG file; Standardizing the size of the bounding box of the initial file to obtain a sample file; Classifying the sample file and dividing the classified sample file into a training set, a validation set and a test set to obtain an SVG dataset; wherein the classification of the sample file specifically includes: Rasterizing the sample file to obtain a raster image; Inputting all the raster images into the image encoder of a preset CLIP model to obtain image features, and inputting all the category labels into the text encoder of the preset CLIP model to obtain text features; For each image feature, the similarity between the image feature and each text feature is calculated, and the category label corresponding to the text feature with the highest corresponding similarity is determined as the correct category of the sample file corresponding to the image feature; Statistical the number of raster images in each correct category, and the top a correct categories with the highest corresponding raster image quantity are taken as the dataset categories; wherein a is a preset ranking threshold; According to the dataset categories, reclassifying all the raster images through the preset CLIP model, calculating the confidence between the reclassified raster images and the corresponding categories, removing the raster images with confidence lower than the preset confidence threshold, and completing the classification.

2. The method of claim 1, wherein the systemized color SVG icon dataset is constructed by: The data cleaning of the collected SVG file to obtain the initial file specifically includes: Confirming the attributes of the SVG file respectively, removing the SVG files lacking the preset fill attribute, and rasterizing the remaining SVG files respectively to obtain corresponding bitmap images; Determine the pixel value of each pixel in the bitmap image, and calculate the proportion of pixels with a pixel value of 0 in all pixels in the bitmap image; Remove the bitmap images with a corresponding proportion of 0 and a corresponding proportion exceeding the preset proportion threshold, and determine the SVG file corresponding to the remaining bitmap image as the initial file.

3. The method of constructing a dataset of systematized color SVG icons of claim 1, wherein, The standardization processing of the size of the bounding box of the initial file to obtain the sample file specifically includes: Uniformly adjusting the size of the bounding box of all the initial files to a preset edge threshold to obtain the sample file.

4. The method of claim 3, wherein the systemized color SVG icon dataset is constructed by: Before the standardization processing of the initial file, it also includes: The initial file is divided into a plurality of files <g>The attributes of the tag are transferred to the <g>After the sub-nodes of the tag, remove the said <g>Label.< / g> < / g> < / g> 5. The method of constructing a dataset of systematized color SVG icons of claim 1, wherein, The division of the training set, the validation set and the test set according to the classified sample file to obtain the SVG dataset specifically includes: According to the preset training set quantity, the validation set quantity and the test set quantity, the classified sample file is divided by stratified sampling to obtain the SVG dataset.

6. A systematized color SVG icon dataset construction apparatus, characterized by, Comprise: Collecting module, standardization module and classification module; The collection module is used for collecting SVG files and performing data cleaning on the collected SVG files to obtain initial files; wherein the SVG files include SVG icons of different categories, and the initial files are color SVG files; the collection of SVG files specifically includes: The icon categories in the Icon645 dataset are filtered and expanded to obtain a plurality of collection categories; SVG icons of different collection categories are collected from an open source platform, and all the SVG icons are labeled with corresponding category labels to obtain SVG files; The standardization module is used for standardizing the size of the bounding box of the initial files to obtain sample files; The classification module is used for classifying the sample files and dividing training set, validation set and test set according to the classified sample files to obtain an SVG dataset; wherein the classification of the sample files specifically includes: The sample files are rasterized to obtain raster images; All the raster images are input into the image encoder of a preset CLIP model to obtain image features, and all the category labels are input into the text encoder of the preset CLIP model to obtain text features; For each image feature, the similarity between the image feature and each text feature is calculated, and the category label corresponding to the text feature with the highest corresponding similarity is determined as the correct category of the sample file corresponding to the image feature; The number of raster images in each correct category is counted, and the top a correct categories with the highest corresponding raster image numbers are taken as dataset categories; wherein a is a preset ranking threshold; According to the dataset categories, all the raster images are reclassified by the preset CLIP model, the confidence between the reclassified raster images and the corresponding categories is calculated, and the raster images with a confidence lower than a preset confidence threshold are removed to complete the classification.

7. The systemized color SVG icon's dataset constructing means of claim 6, wherein, The collection module is used for collecting SVG files, specifically including: The icon categories in the Icon645 dataset are filtered and expanded to obtain a plurality of collection categories; SVG icons of different collection categories are collected from an open source platform, and all the SVG icons are labeled with corresponding category labels to obtain SVG files.

8. The systemized color SVG icon's dataset constructing means of claim 6, wherein, The standardization module is used for standardizing the size of the bounding box of the initial files to obtain sample files, specifically including: The size of the bounding box of all the initial files is uniformly adjusted to a preset bounding box threshold to obtain the sample files.

Citation Information

Patent Citations

  • Text classification method

    CN106095996A

  • Method for building SVG icon library

    CN117435566A