A method, system and equipment for dynamic coding of materials
By extracting material features through a multimodal attention mechanism and an improved residual network, dynamic codes are generated, which solves the problems of material coding automation and hash collisions in ERP systems, and achieves accuracy and consistency in material identification.
Patent Information
- Application Number
- CN202511099806.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-07
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-08-07
AI Technical Summary
Existing ERP systems cannot dynamically generate codes when faced with new materials that are not pre-stored or when the status of materials changes, which leads to cumbersome and error-prone manual intervention, and the calculation of a single feature hash value can make it difficult to distinguish materials.
A multimodal attention mechanism is used to extract the geometric, texture and structural features of the material. Dynamic encoding is generated through an improved residual network and spatial pyramid pooling. Combined with multi-dimensional feature weighting and hash value calculation, hash collisions are avoided.
It improves the accuracy of material identification and the uniqueness of hash values, reduces the probability of collisions caused by a single feature, and achieves automation and consistency in material coding.
Smart Images

Figure CN120597838B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of data processing technology, and in particular relates to a method, system and device for dynamic coding of materials. Background Technology
[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.
[0003] Existing ERP (Enterprise Resource Planning) systems rely on pre-stored rules to generate static codes. When new materials not pre-stored appear on-site, or when material status changes in real time (e.g., mixed storage, relocation), the system cannot dynamically generate or update codes. Manual intervention is required, involving an approval process: creation → approval → barcode printing → scanning → verification, which is time-consuming. Furthermore, new material attribute identification relies on human experience, resulting in cumbersome procedures, high training costs, and susceptibility to code duplication and attribute misjudgments due to subjective judgment bias. After material process adjustments or location changes, static codes cannot be automatically updated, leading to inconsistencies between system data and physical information, requiring manual maintenance and posing risks of omissions and delays.
[0004] While there are existing schemes that automatically encode materials by extracting material features, the calculation of material hash values relies on a single feature, which can easily lead to material hash collisions and make it difficult to guarantee effective differentiation between different materials. Summary of the Invention
[0005] To overcome the shortcomings of the prior art, the present invention provides a material dynamic coding method, system and device, which avoids the collision that is easy to occur when calculating hash value by a single feature vector, enhances the semantic correlation between hash value and material attributes, and reduces the probability of collision caused by a single feature.
[0006] To achieve the above objectives, the present invention adopts the following technical solution:
[0007] In a first aspect, the present invention provides a method for dynamic coding of materials, comprising:
[0008] Preprocess the image of the material to be identified;
[0009] Based on the preprocessed image of the material to be identified, the geometric features, texture features, and structural features of the material to be identified are extracted and fused. Based on the material type corresponding to the material to be identified, the texture features, color features, and shape features are enhanced and dynamically weighted through a multimodal attention mechanism to filter out the features of the material to be identified.
[0010] The hash value of the material to be identified is calculated based on its characteristics. The hash value is then used to determine whether the material is an existing material. If not, a dynamic code is generated based on the hash value of the material to be identified.
[0011] Secondly, the present invention provides a material dynamic coding system, comprising:
[0012] The image preprocessing module is configured to preprocess the image of the material to be identified.
[0013] The feature extraction module is configured to: extract the geometric features, texture features and structural features of the material to be identified based on the preprocessed image of the material to be identified and fuse them; and enhance and dynamically weight the texture features, color features and shape features based on the material type corresponding to the material to be identified through a multimodal attention mechanism to filter and obtain the features of the material to be identified.
[0014] The hash generation module is configured to: calculate the hash value of the material to be identified based on its characteristics; determine whether the material is an existing material based on the calculated hash value; and generate a dynamic code based on the hash value of the material to be identified if it is not.
[0015] In a third aspect, the present invention provides an electronic device comprising a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein the computer instructions, when executed by the processor, perform the method described in the first aspect.
[0016] The above one or more technical solutions have the following beneficial effects:
[0017] In this invention, geometric, texture, and structural features of the material to be identified are extracted and fused. Then, based on the material type corresponding to the material to be identified, a multimodal attention mechanism is used to enhance and dynamically weight the texture, color, and shape features to obtain the features of the material to be identified. The feature extraction method of this invention can cover the core attributes of the material and dynamically weights the corresponding features according to the material type, improving the accuracy of material identification, ensuring the adaptability of feature extraction in various scenarios, and avoiding feature distortion caused by differences in material type. The hash value of the material to be identified is calculated based on the features of the material to be identified. The calculated hash value is used to determine whether the material is an existing material. If not, a dynamic code is generated based on the hash value of the material to be identified. This invention avoids the problem of collisions that easily occur when calculating hash values from a single feature vector, enhances the semantic correlation between hash values and material attributes, and reduces the probability of collisions caused by a single feature.
[0018] In this invention, by adding a parallel spatial feature branch on top of the residual block, the gradient vanishing problem that may occur in deep training of traditional convolutional networks is solved, ensuring the effective preservation of basic material features such as overall contour and light-dark contrast. The variable convolution in the spatial feature branch adaptively learns the material contour offset, which can dynamically adapt to complex shapes such as bending and deformation of materials, solving the problem of inaccurate extraction of geometric features of irregular materials by traditional fixed convolution. Parallel convolutional layers with different receptive fields achieve full-scale geometric feature coverage from micro-details to macro-shapes, avoiding feature omission at a single scale. Spatial pyramid pooling extracts material features, realizing the integration of global and local information of geometric features, while naturally extending to extract texture features such as surface texture and gloss, and structural features such as component assembly relationships, improving the multi-dimensional expressive power of features.
[0019] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0020] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0021] Figure 1 This is a flowchart of the material dynamic coding method in Embodiment 1 of the present invention;
[0022] Figure 2 This is a flowchart of the preprocessing process in Embodiment 1 of the present invention;
[0023] Figure 3 This is a schematic diagram of the spatial pyramid pooling branch network structure in Embodiment 1 of the present invention;
[0024] Figure 4 This is a schematic diagram of the improved residual network structure in Embodiment 1 of the present invention;
[0025] Figure 5 This is a schematic diagram of the material dynamic coding system in Embodiment 2 of the present invention. Detailed Implementation
[0026] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0027] It should be noted that the terminology used herein is for the purpose of describing particular implementations only and is not intended to limit the exemplary implementations of the present invention.
[0028] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0029] Example 1
[0030] This embodiment discloses a dynamic material coding method, including:
[0031] Preprocess the image of the material to be identified;
[0032] Based on the preprocessed image of the material to be identified, the geometric features, texture features, and structural features of the material to be identified are extracted and fused. Based on the material type corresponding to the material to be identified, the texture features, color features, and shape features are enhanced and dynamically weighted through a multimodal attention mechanism to obtain the features of the material to be identified.
[0033] The hash value of the material to be identified is calculated based on its characteristics. The hash value is then used to determine whether the material is an existing material. If not, a dynamic code is generated based on the hash value of the material to be identified.
[0034] The following is combined with Figure 1 This embodiment provides a detailed description of a dynamic material coding method:
[0035] Step 1: Preprocess the image of the material to be identified.
[0036] like Figure 2 As shown, in this embodiment, the image of the material to be identified is converted to grayscale. A weighted average method is used to convert the color image into a single-channel grayscale image, reducing data dimensionality while retaining the main texture features. Subsequently, a Gaussian filter with a kernel size of 5×5 and a standard deviation σ=1.0 is applied for noise reduction. This process smooths random noise in the image, such as illumination fluctuations and sensor errors, through convolution operations, while preserving edge information. Then, an adaptive threshold binarization algorithm is used to convert the image into a binary image. The optimal threshold is automatically determined by calculating the bimodal characteristics of the image histogram to ensure effective separation of the label area from the background.
[0037] Optionally, for images with tilt or perspective distortion, perspective transformation is used to correct tilted labels: first, the four vertices of the label are identified using the Harris corner detection algorithm, and then the image is projected onto a standard plane based on the perspective transformation matrix; finally, the processed image is normalized to a size of 224×224 pixels, and the bilinear interpolation algorithm is used to maintain the image ratio while adapting to the input requirements of the subsequent deep learning model. This size selection balances feature detail preservation and computational efficiency, ensuring that the subsequent deep learning model can effectively extract the key features of the material label.
[0038] Step 2: Based on the preprocessed image of the material to be identified, extract the geometric features, texture features, and structural features of the material to be identified and fuse them. Based on the material type corresponding to the material to be identified, enhance and dynamically weight the texture features, color features, and shape features through a multimodal attention mechanism to obtain the features of the material to be identified.
[0039] In this embodiment, an improved residual network is used to extract and fuse the geometric, texture, and structural features of the material to be identified from the preprocessed image of the material to be identified. Specifically:
[0040] Preliminary features of the material to be identified are extracted using residual blocks;
[0041] Geometric features of the material to be identified are extracted by using variable convolution and parallel convolutional layers with different receptive fields.
[0042] The global-local information of geometric features is integrated by spatial pyramid pooling, and the texture and structural features of the material to be identified are extracted.
[0043] The preliminary features, geometric features, texture features, and structural features of the extracted material to be identified are spliced and fused together.
[0044] In this embodiment, as Figure 4 As shown, the improved residual network adds a spatial feature branch to the original residual block. The original residual block, i.e. the main branch, extracts the spatial features of the material to be identified, such as length, width, height, and shape (e.g., circle, rectangle). The spatial feature branch is specifically used to capture geometric attributes such as size and shape. The outputs of the main branch and the spatial feature branch are concatenated and processed by the ReLU activation function to obtain the output of the improved residual network.
[0045] Specifically, the spatial feature branch includes a parallel variable convolution branch, a shape feature extraction branch, and a spatial pyramid pooling branch.
[0046] By using variable convolution to extract the geometric features of the material to be identified, and learning the material contour offset through adaptive convolution kernel, problems such as bent and deformed materials can be solved.
[0047] The shape feature extraction branch includes parallel micro, meso, and macro layers. The micro layer uses 3x3 convolution with dilation=1 and a receptive field of 5x5 pixels to capture fine structural features such as bolt threads. The meso layer uses 3x3 convolution with dilation=1 and a receptive field of 9x9 pixels to capture the overall contour features of standard parts. The macro layer uses 3x3 convolution with dilation=1 and a receptive field of 13x13 pixels to capture the overall shape of large irregular parts. The outputs of the micro, meso, and macro layers are concatenated and then compressed using a 1×1 convolution to obtain the output of the shape feature extraction branch.
[0048] like Figure 3 As shown, the spatial pyramid pooling branch adopts a four-level pyramid structure. Geometric features are standardized through multi-level spatial partitioning. Max pooling channels retain significant features to the greatest extent, such as prominent edges; averaging channels maintain overall properties, such as uniform texture. Weighted fusion of dual-channel outputs enhances feature robustness.
[0049] Specifically, the spatial pyramid pooling branch includes a first branch, a second branch, a third branch, and a fourth branch. The first branch includes a 1x1 pooling layer connected in sequence, along with parallel max pooling and average pooling layers in two channels. The second branch includes a 3x3 pooling layer connected in sequence, along with parallel max pooling and average pooling layers in two channels. The third branch includes a 5x5 pooling layer connected in sequence, along with parallel max pooling and average pooling layers in two channels. The fourth branch includes a 7x7 pooling layer connected in sequence, along with parallel max pooling and average pooling layers in two channels. The outputs of the first, second, third, and fourth branches are weighted and fused to obtain the output of the spatial pyramid pooling branch, which is a standardized 256-dimensional feature vector with fixed outputs: geometric features, texture features, and structural features. Geometric features include size and shape; texture features include surface characteristics; and structural features include component relationships.
[0050] The first branch is used to retain global features and extract the overall outline features of the material, which is suitable for rapid material classification such as bolts, flanges, and gaskets; the second branch is used to retain local features and capture component-level structural features, and identify bolt head types such as hexagonal, round, and square heads; the third branch is used to retain regional features and focus on local detailed features, and detect thread density and edge integrity; the fourth branch is used to retain macroscopic features, detect thread density and edge integrity, and identify material properties such as metallic luster and plastic texture.
[0051] As an optional implementation, the pooling weights are automatically adjusted according to the material type. When a standard part is detected, the micro-level weights are increased, with a weight ratio of 1:3:4:2. When an irregularly shaped part is detected, the macro-level weights are increased, with a weight ratio of 4:2:2:2.
[0052] In this embodiment, based on the material type corresponding to the material to be identified, a multimodal attention mechanism is used to enhance and dynamically weight texture features, color features, and shape features to obtain the features of the material to be identified, specifically:
[0053] The input fused features are subjected to directional gradient analysis using Gabor filter banks, and metallic reflection is suppressed to obtain a texture energy map.
[0054] Spatial attention is used to enhance the labeled regions of the fused features of the input to generate a spatial heatmap;
[0055] The variance of each channel of the input fusion features is dynamically evaluated through a channel attention mechanism to enhance high-value features;
[0056] Based on the material type corresponding to the material to be identified, the outputs of the texture energy map, spatial heat map, and channel attention mechanism are dynamically weighted.
[0057] Traditional attention mechanisms for enhancing the texture recognition of label text and color blocks face several problems: 1. Insufficient texture recognition: the recognition rate of industrial label text is low in low light environments; metallic reflections lead to high distortion rates of color features; 2. Dynamic adaptability issues: fixed weights cannot meet the different weight requirements of various material classifications such as standard parts, customized parts, and raw materials.
[0058] This embodiment employs a multimodal attention mechanism to enhance and dynamically weight texture features, color features, and shape features to obtain the features of the material to be identified.
[0059] The multimodal attention mechanism in this embodiment includes a parallel Gabor filter bank, a spatial attention mechanism, and a channel attention mechanism. The input to the multimodal attention mechanism is the fusion feature output by the improved residual network. The Gabor filter bank performs directional gradient analysis on the input fusion feature, generating an industrially adaptable texture energy map from four directions (0°, 45°, 90°, and 135°) combined with three scales (1, 3, and 5). This process employs a metal reflection suppression algorithm, such as a gain coefficient of 0.7 × illuminance compensation, which effectively solves the problems of inkjet printing blurring and metal reflection, thereby improving the label text recognition rate.
[0060] The spatial attention mechanism processes the fused features of the input through variable convolution to generate a spatial heatmap. It automatically increases the weight response by 3 to 5 times for material label areas such as QR code locations and specification labels, while applying Gaussian attenuation to background interference areas, thereby improving the saliency of key region features by 82%.
[0061] The variance of each feature channel in the fusion feature is evaluated through a channel attention mechanism. For high-variance channels such as material texture / edge features, the variance is preserved and enhanced, such as by a gain of *1.2; while low-variance channels such as noise / uniform background are subject to soft threshold suppression.
[0062] Based on the material type corresponding to the material to be identified, the outputs of the texture energy map, spatial heat map, and channel attention mechanism are dynamically weighted, specifically as follows:
[0063] Blending weight = α * texture energy + β * spatial heat + γ * channel output.
[0064] Where α, β, and γ are texture weight, color weight, and shape weight, respectively.
[0065] In this embodiment, the weights α, β, and γ are determined based on the material type corresponding to the material to be identified. The trained improved residual network outputs the material type corresponding to the material to be identified based on the input image of the material to be identified. Different weights are used for different material types, as shown in Table 1.
[0066] Table 1:
[0067]
[0068] For other types, the values of α, β, and γ are set to default weights, such as α, β, and γ being 0.6, 0.2, and 0.2, respectively.
[0069] The comprehensive features obtained through the multimodal attention mechanism are input into the LightGBM model, and the gain splitting algorithm is activated to calculate the importance of the features. Among them, the material texture features must satisfy the requirement that the Gabor energy value obtained from the directional gradient analysis is greater than the dynamic threshold θ, where θ = 0.7 × ambient illuminance coefficient; the size parameters must reach the industrial benchmark value with a spatial distribution dispersion of more than 15%; and the color features must require the HSV saturation to meet industry standard specifications. After completing the importance assessment, the TOP10 high-value features are obtained.
[0070] Step 3: Calculate the hash value of the material to be identified based on its characteristics. Determine whether the material is an existing material based on the calculated hash value. If not, generate a dynamic code based on the hash value of the material to be identified. This includes:
[0071] Calculate the hash value of the material to be identified based on its characteristics;
[0072] Determine whether the hash value of the material to be identified is a duplicate of the hash value in the database;
[0073] If the hash value of the material to be identified is not repeated, a dynamic code is generated.
[0074] If duplicates are found, the similarity between the material to be identified and conflicting materials in the database is determined. If the similarity exceeds a set threshold, an enhanced hash value is generated for the material to be identified.
[0075] In this embodiment, the obtained material features to be identified are standardized, and the Z-Score method is used to eliminate the influence of different feature dimensions, ensuring that the contribution of each feature to the hash value is balanced. The formula is: z = (x-μ) / σ, where x is the original data, μ is the mean, and σ is the standard deviation. Subsequently, a weighted concatenation strategy based on feature priority is applied to the material attributes. The weighted feature vector is: weighted feature vector = (material feature vector × 0.6)||(size feature vector × 0.3)||(process and other feature vectors × 0.1), where "||" indicates vector concatenation operation. This strategy enhances the semantic correlation between the hash value and the material attributes and can reduce the probability of hash collisions under a single feature vector.
[0076] A timestamp is introduced, and the SHA-256 hash algorithm is used to calculate the concatenated feature vector and the collection timestamp.
[0077] Simultaneously, a collision detection mechanism is added. When hash values are duplicated, a similarity-aware dual-path hashing mechanism is triggered. Through a multi-dimensional feature comparison algorithm, accurate identification of similar materials is achieved. The specific implementation process is as follows:
[0078] Specifically, database-level constraints are established in the database, automatic conflict detection is achieved through unique database indexes, and the process is triggered by DuplicateKeyException.
[0079] Feature extraction is performed on the material to be identified and conflicting materials in the database using a residual network. Specifically, a 5x5 pixel micro layer is used for thread spacing detection; a 9x9 pixel meso layer is used for contour comparison; and a 13 × 13 pixel macro layer is used for reflective property analysis. Then, spatial pyramid comparison is used to calculate similarity. Subsequently, dynamic weight allocation is performed based on material type, and finally, a decision is made on whether the value exceeds a set threshold, such as 0.85.
[0080] If the similarity exceeds a set threshold, an enhanced hash value is generated for the material to be identified, specifically:
[0081] Acquire macro images of the material to be identified and conflicting materials in the database;
[0082] The macro images of the material to be identified and the conflicting materials in the database are analyzed for differences in color channels, texture channels, and structural similarities to generate a three-dimensional difference heatmap.
[0083] The directional gradient histogram is extracted from the generated three-dimensional difference heatmap, and the directional gradient histogram is filtered to obtain the filtered features;
[0084] The directional gradient histogram, filtering features, and structural features of the material to be identified are weighted and fused together, and an enhanced hash value is generated based on the fused features.
[0085] Specifically, when the judgment exceeds the set threshold, an industrial camera is first activated to perform macro photography, accurately capturing the microscopic features of the material surface. Then, multimodal difference localization is initiated, analyzing color channel differences based on HSV color space comparison, analyzing texture channel differences through Sobel edge gradient detection, and obtaining a structural similarity map using the SSIM algorithm, thereby generating a three-dimensional difference heatmap. Next, HOG gradient analysis is performed based on 16×16 pixel blocks and 9-direction histogram quantization to accurately resolve microstructural features. Then, directional texture differences are enhanced using a four-angle Gabor filter group (0°, 45°, 90°, 135°). Finally, a dynamic weighting strategy, such as HOG feature weight 0.5, Gabor feature weight 0.3, and structural feature weight 0.2, is used to fuse multidimensional feature vectors and generate an enhanced hash value with the "DELTA" identifier.
[0086] This embodiment regenerates hash values by adding local detailed features to ensure their uniqueness. The hash values are then converted to 128-bit hexadecimal encoding and compressed, preserving their uniqueness while facilitating system storage and transmission. The generated hash value serves as the unique value for each material.
[0087] If the extracted feature vector, after hash calculation, yields the value a1b2c3d4, the warehouse identifier is WH001, and the prefix is TEMP, then the dynamic coding generation rule is: TEMP_WH001_a1b2c3d4. This dynamic code will be returned to the operator's document creation interface in real time. When the operator submits a document to the ERP system, the system automatically detects the material code prefix: if it is identified as starting with TEMP, the ERP system triggers a call to the RESTful interface of the patented module. The interface will return a structured feature data package containing information such as material geometric features, texture features, and hash values. The ERP system parses the feature data based on pre-defined classification rules such as material-size-process matching tables, automatically generating a formal material number conforming to the enterprise coding specifications, for example: MAT-WH001-20250625-001, and synchronously updating the material master data field of the document, realizing the automated conversion from temporary code to formal code.
[0088] The following provides an example of the database table structure that may be involved in the implementation of this embodiment;
[0089] Table 2: Material Characteristic Collection Table
[0090]
[0091] Table 3: Feature Vector Storage Table
[0092]
[0093] Table 4: Temporary Material Code Table
[0094]
[0095] Table 5: Formal Material Code Table
[0096]
[0097] Table 6: ERP Code Generation Record Table
[0098]
[0099] Table 7: ERP Interface Call Log Table
[0100]
[0101] The relationships between the various tables are as follows: Material Feature Acquisition Table → Feature Vector Storage Table: one-to-many relationship via feature_id; Feature Vector Storage Table → Temporary Material Code Table: one-to-one relationship via hash_value; Temporary Material Code Table → Official Material Code Table: one-to-one relationship via temp_code_id; Feature Vector Storage Table → Official Material Code Table: one-to-one relationship via hash_value; Temporary Material Code Table → ERP Code Generation Record Table: relationship via temp_code_id; Official Material Code Table → ERP Interface Call Log Table: relationship via material_id; Official Material Code Table → ERP Interface Call Log Table: relationship via material_id.
[0102] Example 2
[0103] like Figure 5 As shown, the purpose of this embodiment is to provide a dynamic material coding system, including:
[0104] The image preprocessing module is configured to preprocess the image of the material to be identified.
[0105] The feature extraction module is configured to: extract the geometric features, texture features and structural features of the material to be identified based on the preprocessed image of the material to be identified and fuse them; and enhance and dynamically weight the texture features, color features and shape features based on the material type corresponding to the material to be identified through a multimodal attention mechanism to filter and obtain the features of the material to be identified.
[0106] The hash generation module is configured to: calculate the hash value of the material to be identified based on its characteristics; determine whether the material is an existing material based on the calculated hash value; and generate a dynamic code based on the hash value of the material to be identified if it is not.
[0107] In further embodiments, the following is also provided:
[0108] An electronic device includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor. When executed by the processor, the computer instructions perform the method described in Embodiment 1. For brevity, further details are omitted here.
[0109] It should be understood that in this embodiment, the processor can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.
[0110] Memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of memory may also include non-volatile random access memory. For example, memory may also store information about the device type.
[0111] A computer-readable storage medium for storing computer instructions, which, when executed by a processor, perform the method described in Embodiment 1.
[0112] The method in Embodiment 1 can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor. The software modules can reside in readily available storage media in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, a detailed description is not provided here.
[0113] Those skilled in the art will recognize that the units and algorithm steps described in conjunction with the embodiments herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0114] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.
Claims
1. A method for dynamic coding of materials, characterized in that, include: Preprocess the image of the material to be identified; Based on the preprocessed image of the material to be identified, the geometric features, texture features, and structural features of the material to be identified are extracted and fused. Based on the material type corresponding to the material to be identified, the texture features, color features, and shape features are enhanced and dynamically weighted through a multimodal attention mechanism to filter out the features of the material to be identified. Calculate the hash value of the material to be identified based on its characteristics. Determine whether the material is an existing material based on the calculated hash value. If not, generate a dynamic code based on the hash value of the material to be identified. This includes calculating the hash value of the material to be identified based on its characteristics; determining whether the hash value of the material to be identified is the same as the hash value in the database; and if so, determining the similarity between the material to be identified and conflicting materials in the database. If the similarity exceeds a set threshold, an enhanced hash value is generated for the material to be identified: Acquire macro images of the material to be identified and conflicting materials in the database; The macro images of the material to be identified and the conflicting materials in the database are analyzed for differences in color channels, texture channels, and structural similarities to generate a three-dimensional difference heatmap. The directional gradient histogram is extracted from the generated three-dimensional difference heatmap, and the directional gradient histogram is filtered to obtain the filtered features; The directional gradient histogram, the filtering features, and the structural features of the material to be identified are weighted and fused together, and an enhanced hash value is generated based on the fused features.
2. The material dynamic coding method as described in claim 1, characterized in that, The preprocessing includes: converting the image of the material to be identified to grayscale; performing noise reduction using Gaussian filtering; and converting the image into a binary image using an adaptive threshold binarization algorithm.
3. The material dynamic coding method as described in claim 1, characterized in that, Based on the preprocessed image of the material to be identified, the geometric features, texture features, and structural features of the material to be identified are extracted and fused, specifically as follows: Preliminary features of the material to be identified are extracted using residual blocks; Geometric features of the material to be identified are extracted by using variable convolution and parallel convolutional layers with different receptive fields. The global-local information of geometric features is integrated by spatial pyramid pooling, and the texture and structural features of the material to be identified are extracted. The preliminary features, geometric features, texture features, and structural features of the extracted material to be identified are spliced and fused together.
4. The material dynamic coding method as described in claim 1, characterized in that, Based on the material type corresponding to the material to be identified, a multimodal attention mechanism is used to enhance and dynamically weight texture features, color features, and shape features to obtain the features of the material to be identified, specifically: The input fused features are subjected to directional gradient analysis using Gabor filter banks, and metallic reflection is suppressed to obtain a texture energy map. Spatial attention is used to enhance the labeled regions of the fused features of the input to generate a spatial heatmap; The variance of each channel of the input fusion features is dynamically evaluated through a channel attention mechanism to enhance high-value features; Based on the material type corresponding to the material to be identified, the outputs of the texture energy map, the spatial heat map, and the channel attention mechanism are dynamically weighted.
5. The material dynamic coding method as described in claim 4, characterized in that, The comprehensive features obtained by weighting based on the multimodal attention mechanism are input into the LightGBM model for filtering to identify the material type corresponding to the material to be identified.
6. The material dynamic coding method as described in claim 1, characterized in that, The hash value of the material to be identified is calculated based on its characteristics. The hash value is then used to determine if the material is an existing material. If not, a dynamic code is generated based on the hash value. This process also includes: Calculate the hash value of the material to be identified based on its characteristics; Determine whether the hash value of the material to be identified is a duplicate of the hash value in the database; If the hash value of the material to be identified is not repeated, a dynamic code is generated.
7. The material dynamic coding method as described in claim 5, characterized in that, The LightGBM model uses a gain splitting algorithm to calculate the importance of the input comprehensive features, evaluates whether the material texture features, size parameters and color features meet the corresponding preset conditions, and determines the material type corresponding to the material to be identified based on the obtained high-value features.
8. A material dynamic coding system, employing a material dynamic coding method as described in any one of claims 1-7, characterized in that, include: The image preprocessing module is configured to preprocess the image of the material to be identified. The feature extraction module is configured to: extract the geometric features, texture features and structural features of the material to be identified based on the preprocessed image of the material to be identified and fuse them; and enhance and dynamically weight the texture features, color features and shape features based on the material type corresponding to the material to be identified through a multimodal attention mechanism to filter and obtain the features of the material to be identified. The hash generation module is configured to: calculate the hash value of the material to be identified based on its characteristics; determine whether the material is an existing material based on the calculated hash value; and generate a dynamic code based on the hash value of the material to be identified if it is not.
9. An electronic device, characterized in that, It includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, which, when executed by the processor, perform the method according to any one of claims 1-7.
Citation Information
Patent Citations
Single-shaft shredding machine based on garbage classification and recovery and garbage identification method
CN117380374A
Material retrieval method and device, computer equipment and storage medium
CN119669534A
Numerical control machining defect real-time detection method and system based on AI image recognition and medium
CN120279024A