Standardized process algorithm of interior design electronic drawing for improving AI recognition rate

By designing a standardized process algorithm for vector data of home decoration design drawings, the problem of information loss and distortion in the AI ​​recognition model input preprocessing is solved, and a more efficient and accurate AI recognition effect is achieved.

CN119919282APending Publication Date: 2025-05-02FUJIAN FOXIT SOFTWARE DEV LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311422168.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-30
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

When processing vector data of home decoration design drawings, the scaling process is prone to destroy linear features and fails to effectively consider the highly dependent structural relationship between vector data, resulting in information loss and distortion in the preprocessing of input data of the AI ​​recognition model.

Method used

It provides a standardized process algorithm for electronic drawings in residential interior design. By calculating the best matching scaling ratio between vector data and A4 standard size, selecting appropriate vector information parameters, performing data type conversion and image information degree calculation, it is divided into low information density and high information density images for different processing, including custom similarity evaluation function selection interpolation algorithm and overlapping sliding window method for cropping processing, ensuring the integrity and consistency of the data.

Benefits of technology

It effectively reduces information loss and distortion in the preprocessing of the input data of the AI ​​recognition model, improves the recognition efficiency and accuracy of the AI ​​recognition model, and enhances the processing ability and stability of the large-span size data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119919282A_ABST
    Figure CN119919282A_ABST
Patent Text Reader

Abstract

The invention discloses an interior design electronic drawing standardization process algorithm for improving the AI recognition rate, and the algorithm comprises the steps: calculating the scaling ratio of the vector data of an electronic drawing to the size of an A4 standard template according to the actual size and the length-width ratio contained in the vector data of the electronic drawing; selecting a preset vector information parameter according to the size of the scaling ratio and the richness of the vector information, performing data type conversion through center template matching, and converting an image of the vector data into a pixel image; carrying out image information degree calculation on the data of the pixel images obtained through conversion as image information richness, and classifying the pixel images into images with high information density and images with low information density by combining the vector information richness; adaptively selecting an interpolation algorithm to carry out scaling processing on the image with low information density through a self-defined similarity evaluation function; carrying out cutting processing on the image with high information density through an overlapping sliding window method; and uniformly transforming the processed image into an input size required by an AI identification model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of vector data primitive recognition and structural analysis of home decoration design drawings, and in particular to a standardized process algorithm for electronic interior design drawings for improving AI recognition rate, and in particular to an algorithm for a standardized process of preprocessing input vector data of an AI recognition model of artificial intelligence. Background Art

[0002] With the development of artificial intelligence technology, intelligent recognition models are being applied in various fields. In the field of home improvement, since design drawings are basically vector data, vector data needs to be converted when using mature AI models. Vector data is composed of simple line segments, and the basic features are simple, but home improvement design drawing data has a highly dependent structural relationship. For the input data of the recognition model, there are currently some pre-processing methods for pixel images, but these methods have the following difficulties in processing vector data:

[0003] 1) Simple and rough scaling will destroy and lose most of the basic features of straight lines;

[0004] 2) Ordinary input data processing methods do not take into account the highly dependent structural relationship between vector data.

[0005] Therefore, studying the algorithm of the standardized process of general residential interior design electronic drawings is not only conducive to improving the recognition rate of the AI ​​recognition model, but also has important theoretical and practical significance for the preprocessing process of vector data when inputting the AI ​​recognition model. Summary of the invention

[0006] The purpose of the present invention is to reduce the information loss and distortion of vector data in the input data preprocessing process of the traditional AI recognition model and improve the recognition efficiency of the AI ​​recognition model, and provide a standardized process algorithm for electronic drawings of residential interior design. When performing AI recognition, the scaling ratio that best matches the A4 standard size can be calculated according to the actual size and aspect ratio of the electronic drawing; different vector information parameters are selected according to the scaling ratio and the richness of vector information, and data type conversion is performed after the central template is matched; according to different images and the richness of vector information, images with different information richness are classified and processed: images with low information density are scaled based on the custom similarity as the standard, and a suitable interpolation algorithm is selected; images with high information density are cropped in the form of overlapping sliding windows to uniformly transform to the optimal input size of the AI ​​model, thereby achieving complete preservation of vector information to improve the recognition efficiency of AI components.

[0007] To achieve the above object, the present invention provides a standardized process algorithm for improving AI recognition rate of interior design electronic drawings, which includes performing the following steps after obtaining vector data of interior design electronic drawings, wherein the main components of the vector data are a variety of different types of primitives:

[0008] Step 1: According to the actual size and aspect ratio of the electronic drawing vector data, calculate the scaling ratio that best matches the A4 standard template size, specifically including matching the long and short sides, calculating the scaling ratio of the long and short sides, and selecting the appropriate scaling ratio based on the calculation results;

[0009] Step 2: According to the obtained scaling ratio and the richness of the vector information, select the preset vector information parameters, perform data type conversion through central template matching, and convert the vector data image into a pixel image;

[0010] Step 3: Calculate the image information degree of the converted pixel image data as the image information richness, and classify the pixel image into a high information density image and a low information density image in combination with the vector information richness;

[0011] Step 4: For images with low information density, the interpolation algorithm is adaptively selected for scaling by using a custom similarity evaluation function; for images with high information density, the overlapping sliding window method is used for cropping;

[0012] Step 5: Transform the processed images uniformly to the input size required by the AI ​​recognition model.

[0013] In one embodiment of the present invention, in the process of calculating the long and short side scaling ratio in step 1, the calculation process of the long and short side scaling ratio is specifically as follows:

[0014] Long side scaling ratio S L The long side of the vector data is divided by the long side of the A4 standard template;

[0015] Short side scaling ratio S S The short side of the vector data is divided by the short side of the A4 standard template;

[0016] Select the maximum scaling ratio as the final scaling ratio S = Max (S L , S S ).

[0017] In one embodiment of the present invention, the center template matching process of step 2 includes rotation judgment, center positioning and edge filling performed in sequence, wherein:

[0018] Rotation judgment is to judge whether rotation is needed. The specific judgment process is as follows:

[0019] Match the long side and the short side of the vector data and the A4 standard template size respectively, and define the angle between the long side of the vector data and the long side of the A4 standard template as the rotation angle. If the rotation angle is 90°, a 90° rotation is required, otherwise no rotation is required;

[0020] The specific process of center positioning is as follows:

[0021] After scaling the original vector data after rotation judgment according to the scaling ratio calculated in step 1, the scaled vector data and the matrix center of the A4 standard template are calculated respectively, and the two are aligned and matched;

[0022] The specific process of edge filling is as follows:

[0023] After alignment and matching, calculate the matching between the long sides and the short sides of the two:

[0024] If there is a complete match, the vector data is directly filled into the A4 standard template;

[0025] Otherwise, calculate the margins on the long and short sides of the vector data after center alignment and matching with the A4 standard template and determine the remaining position, identify the background image of the original vector data, crop the background image according to the size of the scaled vector data, and evenly fill the cropped background image to the margin position.

[0026] In one embodiment of the present invention, the image information degree calculation of the pixel image data in step 3 is to calculate the information entropy of the image data. The specific calculation formula of the information entropy H is:

[0027]

[0028]

[0029] Where i represents the gray value of any pixel, j represents the gray mean of the pixel neighborhood, f(i,j) represents the frequency of occurrence of the feature binary (i,j), N is the scale of the image, and Pi,j represents the comprehensive characteristics of the gray value at the pixel position and the gray distribution of its surrounding pixels.

[0030] In one embodiment of the present invention, the interpolation algorithm in step 4 includes: nearest neighbor interpolation, linear interpolation, regional interpolation and bicubic spline interpolation.

[0031] In one embodiment of the present invention, the specific process of adaptively selecting an interpolation algorithm for scaling processing through a user-defined similarity evaluation function in step 4 is as follows:

[0032] Use different difference algorithms to generate multiple scaled images for any image with low information density;

[0033] A custom similarity evaluation function is used to calculate the similarity between the low information density image and each of the scaled images generated by it;

[0034] The difference algorithm used for the scaled image with the highest similarity is used as the final scaling algorithm to scale the image with low information density.

[0035] In one embodiment of the present invention, in step 4, the self-defined similarity in the self-defined similarity evaluation function is composed of a universal quality index (UQI) function for representing local similarity and a structural similarity (SSIM) function for representing overall structural similarity, wherein the structural similarity (SSIM) function is:

[0036]

[0037] In the formula, x and y represent two images, μ x , μ y Respectively represent the mean of the two images x and y, δ x ,δ y Respectively represent the standard deviation of the two images x and y, δ xy represents the covariance of images x and y, C1 and C2 are constants to maintain stability;

[0038] Among them, the image universal quality index (UQI) function is:

[0039]

[0040] In the formula, x and y represent two images, and the mean of the two images x and y is They are:

[0041]

[0042]

[0043] Variance of two images x and y They are:

[0044]

[0045]

[0046] In one embodiment of the present invention, in step 4, the cutting process using the overlapping sliding window method specifically includes:

[0047] Set the starting point coordinate of the sliding window to the upper left corner of the image;

[0048] Set the overlap rate of sliding window cropping to 0.25;

[0049] The sliding directions are from left to right and from top to bottom, and the end coordinates of the last cropping window that slides to the rightmost and bottommost are aligned with the end coordinates of the image;

[0050] Slide the cropped data and store the mapping coordinates corresponding to each cropped image as the index coordinates for restoring the recognition results; generate a sliding number weight matrix as the restoration weight of the structure analysis structure.

[0051] In one embodiment of the present invention, the input size in step 5 is determined as follows:

[0052] Select the default input data size for the AI ​​recognition model;

[0053] Then select the two sizes of 1024 and 2048;

[0054] These three sizes are passed through the preset training set, validation set and test set, and the most appropriate size is selected as the final size based on the best evaluation result.

[0055] The standardized process algorithm for interior design electronic drawings disclosed in the present invention for improving AI recognition rate has the following advantages and beneficial effects compared with the prior art:

[0056] 1) By calculating the scaling ratio and judging the degree of vector information, the size range of input data is expanded, and the AI ​​recognition model's ability to process large-span size data is improved;

[0057] 2) The central template matching method in data type conversion ensures that the input data center is centered, thus enhancing the stability of the AI ​​recognition model’s recognition effect;

[0058] 3) By dividing the input data into two types, low information density and high information density, and processing the two types of data differently, the recognition efficiency and accuracy of the AI ​​recognition model are improved;

[0059] 4) Through a customized similarity evaluation method, an adaptive scaling interpolation algorithm is selected for images with low information density to ensure the integrity of the information. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0061] Figure 1A schematic diagram of a flow chart of an embodiment of the present invention;

[0062] Figure 2 A schematic diagram of center template matching according to an embodiment of the present invention;

[0063] Figure 3 FIG. 4 is a schematic diagram of overlapping sliding windows according to an embodiment of the present invention. DETAILED DESCRIPTION

[0064] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0065] The present invention is further described in detail below in conjunction with the embodiments and drawings, but the embodiments of the present invention are not limited thereto. Since the present invention relates to the field of home decoration design drawings, the primitives referred to therein are graphic elements stored in vector drawings, such as polylines, polygons, blocks, arcs, texts, and annotations.

[0066] Figure 1 FIG. 1 is a flow chart of an embodiment of the present invention. Figure 1 As shown, this embodiment provides a standardized process algorithm for interior design electronic drawings for improving AI recognition rate, which mainly includes two parts: scaling matching of data conversion and classification processing of data preprocessing. The following is a further detailed description of it in conjunction with the accompanying drawings and specific implementation methods. For ease of understanding, in an example, taking the common residential interior design electronic drawing vector data as an example, the above-mentioned scaling matching and classification preprocessing are explained.

[0067] The standardized process algorithm of this embodiment includes performing the following steps after obtaining the vector data of the electronic drawing of the interior design, wherein the main components of the vector data are a plurality of different types of primitives:

[0068] Step 1: According to the actual size and aspect ratio of the electronic drawing vector data, calculate the scaling ratio that best matches the A4 standard template size, specifically including matching the long and short sides, calculating the scaling ratio of the long and short sides, and selecting the appropriate scaling ratio based on the calculation results;

[0069] In this embodiment, in the process of calculating the long and short side scaling ratio in step 1, since the size of the vector data is larger than the A4 standard size in most cases, the calculation process of the long and short side scaling ratio is specifically as follows:

[0070] Long side scaling ratio S LThe long side of the vector data is divided by the long side of the A4 standard template;

[0071] Short side scaling ratio S S The short side of the vector data is divided by the short side of the A4 standard template;

[0072] In this way, the scaling ratio represents the multiple by which the size of the vector data needs to be reduced to the A4 standard size. To ensure the integrity of the data information, the maximum scaling ratio is selected as the final scaling ratio S = Max (S L , S S ).

[0073] In this embodiment, taking the pixel size of the electronic drawing vector data as 4800*3600 as an example, the pixel size of the A4 standard template with a resolution of 300 pixels / inch is 2479*3508. At this time, the long side of the original electronic drawing vector data is 4800 and the short side is 3600, and the long side of the A4 standard template is 3508 and the short side is 3508. The long side scaling ratio is: The short side scaling ratio is: The overall scaling ratio can be obtained as follows: S = Max (S L , S S )=1.46, so 1.46 is used as the above-mentioned long and short side scaling ratio.

[0074] Step 2: According to the obtained scaling ratio and the richness of vector information, different preset vector information parameters are selected, and data type conversion is performed through central template matching to convert the vector data image into a pixel image, such as converting DWG format data into PNG image format data; the information richness of the vector data is directly determined by the number of primitives. The more primitives there are, the higher the information richness of the vector data;

[0075] In this embodiment, the richness of the vector information is determined by the number of primitives detected in the original vector data, and different preset vector information parameters are selected corresponding to the scale ratio, which are specifically divided into the following four cases:

[0076] 1) When the scaling ratio is large and the vector information is rich, it indicates that the vector data is a relatively complex large-size drawing. In order not to destroy the original drawing data information, it is necessary to select a smaller preset vector information parameter;

[0077] 2) When the scaling ratio is large and the vector information is small, it indicates that the vector data is a relatively simple large-size drawing. In order to preserve the integrity of the information during subsequent scaling processing, a larger preset vector information parameter can be selected;

[0078] 3) When the scaling ratio is small and the vector information is rich, it indicates that the vector data is a relatively complex small-size drawing. In order not to destroy the original drawing data information, it is necessary to select a smaller preset vector information parameter;

[0079] 4) When the scaling ratio is small and the vector information is small, it indicates that the vector data is a relatively simple small-size drawing. In order to retain the integrity of the information during subsequent scaling processing, a larger preset vector information parameter can be selected.

[0080] In this embodiment, the center template matching process of step 2 includes rotation judgment, center positioning and edge filling performed in sequence, wherein:

[0081] Rotation judgment is to judge whether rotation is needed. The specific judgment process is as follows:

[0082] Match the long side and the short side of the vector data and the A4 standard template size respectively, and define the angle between the long side of the vector data and the long side of the A4 standard template as the rotation angle. If the rotation angle is 90°, a 90° rotation is required, otherwise no rotation is required; according to the principle of symmetry, the angle between the short side of the vector data and the short side of the A4 standard template should also be consistent with the rotation angle.

[0083] From the long and short side matching process in step 1, it can be seen that if the long and short sides of the vector image intersect vertically with the long and short sides of the A4 standard size, it is necessary to first determine whether rotation is required during the center template matching. If necessary, rotate it first before performing subsequent operations.

[0084] The specific process of center positioning is as follows:

[0085] After scaling the original vector data after rotation judgment according to the scaling ratio calculated in step 1, the scaled vector data and the matrix center of the A4 standard template are calculated respectively, and the two are aligned and matched;

[0086] Edge filling is to crop the background image outside the overall outline of the original vector data. The cropping size is the maximum complete length and width size recognized, and the cropped background image is filled into the unused part after scaling to ensure the consistency of information features after data conversion. The specific process is as follows:

[0087] After alignment and matching, calculate the matching between the long sides and the short sides of the two:

[0088] If there is a complete match, the vector data is directly filled into the A4 standard template;

[0089] Otherwise, calculate the margins on the long and short sides of the vector data after center alignment and matching with the A4 standard template and determine the remaining position, identify the background image of the original vector data, crop the background image according to the size of the scaled vector data, and evenly fill the cropped background image to the margin position.

[0090] Figure 2 FIG. 1 is a schematic diagram of center template matching according to an embodiment of the present invention. Figure 2 As shown, this embodiment still takes the pixel size of the electronic drawing vector data as 4800*3600 as an example to explain the above step 2 in detail. According to the above calculation, the overall scaling ratio has been determined to be 1.46, so the scaled size of the vector image is calculated to be: 3288*2466, and after rotation, it is: 2466*3288, which is aligned with the pixel size of the A4 standard template: 2479*3508 for center alignment. Since the original drawing and the A4 standard template are both rectangular, that is, symmetrical relative to the center line, the total margin of the short side is: 2479-2466=13, and the margin of the short side on a single side is: 13 / 2=6.5. In the same way, the margin of the long side on a single side is calculated to be: (3508-3288) / 2=110.

[0091] Through the above steps, the number and position of the graphic elements in the original drawing vector data can be counted and calculated, the richness of the vector information and the coordinate range of the background image can be determined, and the vector parameters can be determined according to the richness of the vector; then, according to the coordinate range of the background image, the background image can be cropped out, and the cropped background image can be filled into the remaining area after scaling and rotation; then the vector image can be converted into a pixel image.

[0092] Step 3: Calculate the image information degree of the converted pixel image data as the image information richness, and classify the pixel image into a high information density image and a low information density image in combination with the vector information richness;

[0093] In this embodiment, the image information degree calculation of the pixel image data in step 3 is to calculate the information entropy of the image data. The specific calculation formula of the information entropy H is:

[0094]

[0095]

[0096] Where i represents the gray value of any pixel (0≤i≤255), j represents the gray mean of the pixel neighborhood (0≤j≤255), f(i,j) represents the frequency of occurrence of the feature binary (i,j), N is the scale of the image, and Pi,j represents the comprehensive characteristics of the gray value at the pixel position and the gray distribution of its surrounding pixels.

[0097] Step 4: For images with low information density, the interpolation algorithm is adaptively selected for scaling by using a custom similarity evaluation function; for images with high information density, the overlapping sliding window method is used for cropping;

[0098] In this embodiment, in step 4, the interpolation algorithm includes: nearest neighbor interpolation, linear interpolation, regional interpolation and bicubic spline interpolation. These scaling interpolation algorithms can be called through the interpolation algorithm parameters of the scaling function in the OpenCV tool library, and the specific method can be:

[0099] Nearest neighbor interpolation:

[0100] Nearest_img=cv2.resize(simple_img,dsize,dst=None,fx=None,fy=None,interpolation=INTER_NEAREST)

[0101] Linear interpolation (default):

[0102] Linear_img=cv2.resize(simple_img,dsize,dst=None,fx=None,fy=None,interpolation=INTER_LINEAR)

[0103] Areal interpolation:

[0104] Area_img=cv2.resize(simple_img,dsize,dst=None,fx=None,fy=None,interpolation=INTER_AREA)

[0105] Cubic spline interpolation:

[0106] Cubic_img=cv2.resize(simple_img,dsize,dst=None,fx=None,fy=None,interpolation=INTER_CUBIC)

[0107] The interpolation parameter represents the interpolation algorithm type, or the interpolation method. The default is linear interpolation. The interpolation method can be set to the following values:

[0108] INTER_NEAREST: Nearest neighbor interpolation

[0109] INTER_LINEAR: Linear interpolation (default)

[0110] INTER_AREA: Area interpolation

[0111] INTER_CUBIC: 4*4 pixel area cubic spline interpolation

[0112] In this embodiment, the specific process of adaptively selecting the interpolation algorithm for scaling processing through the user-defined similarity evaluation function in step 4 is as follows:

[0113] Use different difference algorithms to generate multiple scaled images for any image with low information density;

[0114] A custom similarity evaluation function is used to calculate the similarity between the low information density image and each of the scaled images generated by it;

[0115] The difference algorithm used for the scaled image with the highest similarity is used as the final scaling algorithm to scale the image with low information density.

[0116] In addition, in order to ensure an unchanged proportional characteristic, the proportional factor calculation method in step 1 and the central template matching method in step 2 may also be used for processing.

[0117] In this embodiment, in step 4, the custom similarity in the custom similarity evaluation function is composed of a Universal Quality Image Index (UQI) function for representing local similarity and a structural similarity (SSIM) function for representing overall structural similarity, wherein the structural similarity (SSIM) function is:

[0118]

[0119] In the formula, x and y represent two images, μ x , μ y Respectively represent the mean of the two images x and y, δ x ,δ y Respectively represent the standard deviation of the two images x and y, δ xy represents the covariance of images x and y, C1 and C2 are constants to maintain stability;

[0120] Among them, the image universal quality index (UQI) function is:

[0121]

[0122] In the formula, x and y represent two images, and the mean of the two images x and y is They are:

[0123]

[0124]

[0125] Variance of two images x and y They are:

[0126]

[0127]

[0128] In this embodiment, in step 4, the cutting process using the overlapping sliding window method specifically includes:

[0129] Set the starting point coordinate of the sliding window to the upper left corner of the image, which is also the origin of the commonly used coordinate system of the image;

[0130] Set the overlap rate of sliding window cropping to 0.25, where the sliding overlap rate specifically represents the proportion of the same data in the previous cropped image and the next cropped image. For details, see Figure 3 , Figure 3 This is a schematic diagram of an overlapping sliding window according to an embodiment of the present invention. The purpose of sliding and cutting data is to eliminate edge effects that may occur during model reasoning.

[0131] The sliding directions are from left to right and from top to bottom. When sliding to the rightmost and bottommost, it is highly likely that the corresponding sliding overlap ratio cannot be satisfied at the same time within the coordinate range of the original image data. Therefore, the coordinates at the end (rightmost and bottommost) should be used as the end coordinates of the sliding window, that is, the end coordinates of the last cropping window that slides to the rightmost and bottommost should be aligned with the end coordinates of the image.

[0132] Slide the cropped data and store the mapping coordinates corresponding to each cropped image, such as the starting pixel coordinates, as the index coordinates for restoring the recognition results; generate a sliding number weight matrix as the restoration weight of the structure analysis structure.

[0133] Among them, the above sliding window size can be the optimal input size in the AI ​​recognition model experiment. The optimal input size can be obtained from the evaluation results of the actual experiment. By saving the index coordinates and weight matrix of each sliding window, the prediction results of the AI ​​recognition model can be restored to the original data coordinates.

[0134] Step 5: Transform the processed different images uniformly to the input size required by the AI ​​recognition model.

[0135] In this embodiment, the input size in step 5 is determined as follows:

[0136] Select the default input data size for the AI ​​recognition model;

[0137] Then select 1024 and 2048 sizes. The reason for selecting 1024 and 2048 is that the preset input size of most AI recognition models is 256, 512, etc., and 2048 is the closest to the A4 standard size. It can input a larger data range into the AI ​​recognition model, thereby enhancing the stability of the inference result. 1024 is the second-level size data set to balance the GPU resources.

[0138] The three sizes are put through a preset training set, a validation set and a test set, and the most suitable size is selected as the final size according to the best evaluation result. The evaluation method can adopt any existing method, and the present invention is not limited thereto.

[0139] After the above steps, the data input to the AI ​​recognition model can have the same size, so it can be processed in batches according to the hardware performance to improve processing efficiency. After being processed by the above electronic drawing standardization process algorithm, the original information characteristics can be retained to the greatest extent, while improving the recognition rate of the AI ​​recognition model, it can also improve the model's reasoning ability.

[0140] Those skilled in the art can understand that the accompanying drawings are only schematic diagrams of an embodiment, and the modules or processes in the accompanying drawings are not necessarily required to implement the present invention.

[0141] Those skilled in the art can understand that the modules in the device in the embodiment can be distributed in the device in the embodiment according to the description of the embodiment, or can be changed accordingly and located in one or more devices different from the embodiment. The modules in the above embodiment can be combined into one module, or can be further divided into multiple sub-modules.

[0142] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A standardized process algorithm for improving AI recognition rate of interior design electronic drawings, comprising the following steps after obtaining vector data of interior design electronic drawings, wherein the main components of the vector data are a plurality of different types of primitives, characterized in that: Step 1: According to the actual size and aspect ratio of the electronic drawing vector data, calculate the scaling ratio that best matches the A4 standard template size, specifically including matching the long and short sides, calculating the scaling ratio of the long and short sides, and selecting the appropriate scaling ratio based on the calculation results; Step 2: According to the obtained scaling ratio and the richness of the vector information, select the preset vector information parameters, perform data type conversion through central template matching, and convert the vector data image into a pixel image; Step 3: Calculate the image information degree of the converted pixel image data as the image information richness, and classify the pixel image into a high information density image and a low information density image in combination with the vector information richness; Step 4: For images with low information density, the interpolation algorithm is adaptively selected for scaling by using a custom similarity evaluation function; for images with high information density, the overlapping sliding window method is used for cropping; Step 5: Transform the processed images uniformly to the input size required by the AI ​​recognition model.

2. According to claim 1, the standardized process algorithm for interior design electronic drawings for improving AI recognition rate is characterized in that: In the process of calculating the long and short side scaling ratio in step 1, the calculation process of the long and short side scaling ratio is specifically as follows: Long side scaling ratio S L The long side of the vector data is divided by the long side of the A4 standard template; Short side scaling ratio S S The short side of the vector data is divided by the short side of the A4 standard template; Select the maximum scaling ratio as the final scaling ratio S = Max (S L , S S ).

3. The standardized process algorithm for interior design electronic drawings for improving AI recognition rate according to claim 1 is characterized in that: The center template matching process of step 2 includes rotation judgment, center positioning and edge filling performed in sequence, wherein: Rotation judgment is to judge whether rotation is needed. The specific judgment process is as follows: Match the long side and the short side of the vector data and the A4 standard template size respectively, and define the angle between the long side of the vector data and the long side of the A4 standard template as the rotation angle. If the rotation angle is 90°, a 90° rotation is required, otherwise no rotation is required; The specific process of center positioning is as follows: After scaling the original vector data after rotation judgment according to the scaling ratio calculated in step 1, the scaled vector data and the matrix center of the A4 standard template are calculated respectively, and the two are aligned and matched; The specific process of edge filling is as follows: After alignment and matching, calculate the matching between the long sides and the short sides of the two: If there is a complete match, the vector data is directly filled into the A4 standard template; Otherwise, calculate the margins on the long and short sides of the vector data after center alignment and matching with the A4 standard template and determine the remaining position, identify the background image of the original vector data, crop the background image according to the size of the scaled vector data, and evenly fill the cropped background image to the margin position.

4. The standardized process algorithm for interior design electronic drawings for improving AI recognition rate according to claim 1 is characterized in that: The image information degree calculation of the pixel image data in step 3 is to calculate the information entropy of the image data. The specific calculation formula of the information entropy H is: Where i represents the gray value of any pixel, j represents the gray mean of the pixel neighborhood, f(i,j) represents the frequency of occurrence of the feature binary (i,j), N is the scale of the image, and Pi,j represents the comprehensive characteristics of the gray value at the pixel position and the gray distribution of its surrounding pixels.

5. The standardized process algorithm for interior design electronic drawings for improving AI recognition rate according to claim 1 is characterized in that: The interpolation algorithms in step 4 include: nearest neighbor interpolation, linear interpolation, regional interpolation and bicubic spline interpolation.

6. The standardized process algorithm for interior design electronic drawings for improving AI recognition rate according to claim 5 is characterized in that: In step 4, the specific process of adaptively selecting the interpolation algorithm for scaling processing through the customized similarity evaluation function is as follows: Use different difference algorithms to generate multiple scaled images for any image with low information density; A custom similarity evaluation function is used to calculate the similarity between the low information density image and each of the scaled images generated by it; The difference algorithm used for the scaled image with the highest similarity is used as the final scaling algorithm to scale the image with low information density.

7. The standardized process algorithm for interior design electronic drawings for improving AI recognition rate according to claim 6 is characterized in that: In step 4, the custom similarity in the custom similarity evaluation function is composed of a general image quality index function for representing local similarity and a structural similarity function for representing overall structural similarity, wherein the structural similarity function is: In the formula, x and y represent two images, μ x , μ y Respectively represent the mean of the two images x and y, δ x ,δ y Respectively represent the standard deviation of the two images x and y, δ xy represents the covariance of images x and y, C1 and C2 are constants to maintain stability; Among them, the general image quality index function is: In the formula, x and y represent two images, and the mean of the two images x and y is They are: Variance of two images x and y They are:

8. The standardized process algorithm for interior design electronic drawings for improving AI recognition rate according to claim 1 is characterized in that: In step 4, the cropping process using the overlapping sliding window method specifically includes: Set the starting point coordinate of the sliding window to the upper left corner of the image; Set the overlap rate of sliding window cropping to 0.25; The sliding directions are from left to right and from top to bottom, and the end coordinates of the last cropping window that slides to the rightmost and bottommost are aligned with the end coordinates of the image; The sliding cropping data is stored, and the mapping coordinates corresponding to each cropped image are stored at the same time as the index coordinates for restoring the recognition results, and a sliding number weight matrix is ​​generated as the restoration weight of the structure parsing structure.

9. The standardized process algorithm for interior design electronic drawings for improving AI recognition rate according to claim 1 is characterized in that: The input size of step 5 is determined as follows: Select the default input data size for the AI ​​recognition model; Then select the two sizes of 1024 and 2048; These three sizes are passed through the preset training set, validation set and test set, and the most appropriate size is selected as the final size based on the best evaluation result.