Material management method, system and equipment and storage medium
By dynamically adjusting the data augmentation strength, the problem of insufficient adaptability of model training status in the material management system was solved, and the automated optimization and efficiency improvement of model training were achieved.
Patent Information
- Application Number
- CN202511812675.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-04
- Publication Date
- 2026-02-10
AI Technical Summary
Existing material management systems lack dynamic enhancement methods that automatically adapt to the model training state and material imaging characteristics, resulting in limited improvement in model recognition performance and low deployment efficiency.
The method of dynamically adjusting the data augmentation intensity is adopted. By providing real-time feedback on the model's training status, such as loss, gradient, and confidence, the augmentation difficulty is automatically matched with the model's learning ability, avoiding the blindness of fixed augmentation strategies, including operations such as rotation, brightness adjustment, and adding noise.
It achieves automated optimization of model training, improves material management efficiency, avoids the tediousness of manual parameter tuning, and ensures training stability and performance improvement.
Smart Images

Figure CN121504334A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of materials management, and more particularly to a materials management method, system, device, and storage medium. Background Technology
[0002] In modern intelligent warehousing and material management systems, the use of image recognition technology for automatic material classification, inventory, and quality inspection has become a core component. However, the imaging conditions at the material management site are extremely challenging: uneven lighting (such as backlighting on warehouse shelves and flickering lights), random material placement angles, varying degrees of wear or reflection in packaging boxes, and interference from environmental dust, etc.
[0003] To improve the robustness of models in such complex environments, data augmentation techniques are widely used. The current mainstream approach is to pre-set a fixed augmentation strategy before training, such as uniformly rotating the model by 15 degrees or adjusting brightness by 10%. However, this fixed strategy has significant drawbacks: First, the preset intensity cannot adapt to the model's learning ability at different training stages, potentially leading to early training difficulties or overfitting later; second, a single augmentation level is difficult to match the ever-changing imaging conditions in material management environments; and finally, finding the optimal fixed strategy requires significant manpower for repeated trials, resulting in low efficiency.
[0004] Therefore, existing technologies lack a dynamic enhancement method that can automatically adapt to the model training state and material imaging characteristics, thus limiting further improvement in the performance and deployment efficiency of material recognition models. Summary of the Invention
[0005] The purpose of this invention is to disclose a material management method, system, device, and storage medium to solve the technical problems pointed out in the background art.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a material management method, comprising: S1, Collect material images in material management scenarios and build a training dataset; S2, Initialize the weight parameters of the material recognition model and a global enhancement control factor. ; S3, Execute the training loop, which includes: S30, use Data augmentation is performed on images in the training dataset, and the augmentation operation includes at least one of rotation, brightness adjustment, contrast adjustment, and noise addition. S31, input the enhanced image into the material recognition model, calculate the loss and update the weight parameters of the material recognition model; S32, calculates training dynamic indicators; S33, periodically adjust the dynamic values based on the comparison results between the training dynamic indicators and the target threshold. The value; S34, repeat S30 to S33 until the training termination condition is met. After training ends, output the trained material recognition model. S4 uses the trained material recognition model to manage materials.
[0007] Preferably, S1 includes: S10, Obtain material images from a preset material management scenario; S11, preprocess each material image to obtain the processed image; S12 calculates the similarity between processed images and constructs a training dataset based on the similarity.
[0008] Preferably, the preset material management scenarios include material classification scenarios, material inventory scenarios, and material outbound detection scenarios.
[0009] Preferably, S11 includes: The material image is converted to grayscale to obtain a grayscale image; A filtering algorithm is used to filter the grayscale image to obtain the processed image.
[0010] Preferably, calculating the similarity between processed images includes: Calculate the pairwise similarity between the processed images corresponding to all material images obtained in the same material management scenario.
[0011] Preferably, the construction of the training dataset based on similarity includes: Store all processed images into set U; For each similarity, the following processing is performed: For the obtained similarity sim, the two processed images corresponding to sim are represented as p1 and p2 respectively; If sim is greater than the set similarity threshold, then p1 or p2 will be removed from set U; The training dataset consists of the remaining processed images in set U.
[0012] Preferred global enhancement strength control factor Initialization includes: S21, calculates the complexity metric based on the training dataset; S22, Based on the complexity metric, select one initialization scheme from multiple preset initialization schemes to control the global enhancement strength factor. Perform initialization.
[0013] Secondly, the present invention also provides a material management system, including a data acquisition module, an initialization module, a training module, and a management module; The acquisition module is used to collect material images in material management scenarios and build a training dataset; The initialization module is used to initialize the weight parameters of the material recognition model and a global enhancement control factor. ; The training module is used to execute training loops, which include: S30, use Data augmentation is performed on images in the training dataset, and the augmentation operation includes at least one of rotation, brightness adjustment, contrast adjustment, and noise addition. S31, input the enhanced image into the material recognition model, calculate the loss and update the weight parameters of the material recognition model; S32, calculates training dynamic indicators; S33, periodically adjust the dynamic values based on the comparison results between the training dynamic indicators and the target threshold. The value; S34, repeat S30 to S33 until the training termination condition is met. After training ends, output the final material identification model. The management module is used to manage materials using the trained material recognition model.
[0014] Thirdly, the present invention also provides a computer device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the steps of the above-described material management method.
[0015] Fourthly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, characterized in that the computer program, when executed by a processor, implements the steps of the above-described material management method.
[0016] Beneficial effects: This invention, when using image recognition technology for material management, dynamically adjusts the data augmentation intensity by providing real-time feedback on the model's training status (such as loss, gradient, and confidence). This automatically matches the augmentation difficulty with the model's current learning ability, avoiding the blindness of fixed augmentation strategies. This invention automatically increases the challenge when the model is learning easily, preventing overfitting; and automatically reduces the difficulty when the model is learning difficultly, ensuring training stability and guiding the model to converge to a better performance point. The method described in this invention does not rely on a specific model architecture or augmentation operation and can be widely applied to the training process of various image recognition tasks. It can be flexibly implemented according to different evaluation metrics (loss, gradient, confidence), reducing the workload of manually and repeatedly tuning augmentation hyperparameters in traditional methods. This achieves automated optimization of the training process, improves development efficiency, and thus enhances the efficiency of material management. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a schematic diagram of a material management method according to the present invention.
[0019] Figure 2 This is a schematic diagram of a material management system according to the present invention.
[0020] Figure 3 This is a schematic diagram of the computer device of the present invention. Detailed Implementation
[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0022] Example 1: like Figure 1 As shown in one embodiment, the present invention provides a material management method, comprising: S1: Collect material images in material management scenarios and construct a training dataset.
[0023] This step is mainly to obtain material images under different material management scenarios, so that the model training can be more targeted, thereby improving the accuracy of the model in identifying materials.
[0024] Preferably, S1 includes: S10, Obtain material images from a preset material management scenario; S11, preprocess each material image to obtain the processed image; S12 calculates the similarity between processed images and constructs a training dataset based on the similarity.
[0025] Specifically, in S10, material images are acquired under various shooting conditions (such as adjusting different ambient brightness and different focal lengths) in each material management scenario. Multiple material images are acquired under each shooting condition, which increases the richness of the material images and reduces the intensity of subsequent enhancement, thereby improving the efficiency of model training.
[0026] The S11 preprocessing process can suppress image noise, improve image quality, and help improve the accuracy of the calculated similarity.
[0027] Preferably, the preset material management scenarios include material classification scenarios, material inventory scenarios, and material outbound detection scenarios.
[0028] Material sorting typically occurs during the material receiving stage. Since the transported materials may not be pre-sorted, sorting equipment combined with image recognition technology is needed for classification.
[0029] Material inventory checks typically occur during the material storage phase, primarily through periodic checks to prevent discrepancies between accounting records and actual inventory.
[0030] The material outbound inspection scenario mainly involves automatically counting the materials on the conveyor belt during the outbound process.
[0031] Preferably, S11 includes: The material image is converted to grayscale to obtain a grayscale image; A filtering algorithm is used to filter the grayscale image to obtain the processed image.
[0032] Specifically, bilateral filtering can be used for filtering. Bilateral filtering is a non-linear filtering method that combines spatial proximity and pixel value similarity in an image, taking into account both spatial information and grayscale similarity to achieve edge-preserving denoising. This helps to reduce the impact on image edges while removing noise, thus enabling the image recognition process to acquire more accurate features during subsequent model training.
[0033] Preferably, calculating the similarity between processed images includes: Calculate the pairwise similarity between the processed images corresponding to all material images obtained in the same material management scenario.
[0034] This step is mainly to reduce the similarity between images in the training dataset, so that the trained model can be applied to the recognition of material images obtained under as many shooting conditions as possible.
[0035] Preferably, the construction of the training dataset based on similarity includes: Store all processed images into set U; For each similarity, the following processing is performed: For the obtained similarity sim, the two processed images corresponding to sim are represented as p1 and p2 respectively; If sim is greater than the set similarity threshold, then p1 or p2 will be removed from set U; The training dataset consists of the remaining processed images in set U.
[0036] Specifically, similarity can be represented using SSIM. The set similarity threshold can be 0.7.
[0037] S2, Initialize the weight parameters of the material recognition model and a global enhancement control factor. .
[0038] Specifically, the material recognition model can be selected from image classification models, object detection models, or instance segmentation models based on convolutional neural networks or visual transformers, including but not limited to ResNet, EfficientNet, YOLO, Faster R-CNN, or Mask R-CNN.
[0039] The initialization of weight parameters in step S2 refers to assigning initial values to all learnable parameters in the material recognition model, including but not limited to the weights and biases of each convolutional layer and fully connected layer, as well as the scaling and translation parameters of the batch normalization layer.
[0040] Preferred global enhancement strength control factor Initialization includes: S21 calculates the complexity metric based on the training dataset.
[0041] Specifically, S21 includes: Calculate the complexity metric of the training dataset Using a pre-trained feature extraction model (e.g., ResNet-50) extracts feature vectors from 1% of the processed images randomly selected from the training dataset. Then, it calculates the feature vectors according to the following formula: ; in To manage the variance within the scenario, To average the variance between management scenarios; The calculation process for the variance within the average management scenario and the variance between the average management scenarios is as follows: Assuming the training dataset Include The images are divided into... A materials management scenario. Each image. Corresponding to a management scenario tag Using a pre-trained feature extraction model (Such as ResNet pre-trained on ImageNet) maps images to In a 3D feature space, we obtain the feature vectors. .
[0042] Overall mean eigenvector: ; Mean feature vector of management scenarios (for each material management scenario) ): ; in It is a material management scenario. The number of images processed. This indicates a material management scenario. Index in The feature vectors of the corresponding processed image are traversed.
[0043] Average variance within the management scenario (measures the dispersion of characteristics within the same material management scenario): ; here This represents the Euclidean norm.
[0044] Average variance between management scenarios (measures the degree of separation of characteristics between different material management scenarios): .
[0045] S22, Based on the complexity metric, select one initialization scheme from multiple preset initialization schemes to control the global enhancement strength factor. Perform initialization.
[0046] Specifically, S22 includes: like If the value is less than or equal to 0.5, the global enhancement strength control factor will be adjusted. Initialize to 0.8; like If the value is greater than 0.5 and less than 1, then the global enhancement strength control factor will be adjusted. Initialize to 0.5; like If the value is greater than or equal to 1, the global enhancement strength control factor will be adjusted. Initialized to 0.2.
[0047] if A value less than or equal to 0.5 indicates a simple dataset with significant differences between different management scenarios and minimal differences within the same management scenario. Select aggressive initialization and set... The value was set to 0.8 to quickly improve the model's robustness. Strong data augmentation was introduced early in the training process to rapidly improve the model's robustness and generalization ability, preventing premature overfitting due to the simplicity of the data.
[0048] if A value greater than 0.5 and less than 1 indicates moderate dataset complexity. Choose balanced initialization and set... A value of 0.5 is used as a robust default. This approach is a general and robust strategy, providing equal flexibility for adjustments in both the "enhancement" and "weakening" directions of enhancement. The adaptive algorithm can freely explore either direction based on early training dynamics, avoiding both the slowness that might result from excessively weak initial enhancements and the instability that might lead to excessively strong initial enhancements.
[0049] if A value greater than or equal to 1 indicates a complex dataset, cluttered background, or minimal differences between management scenarios. (Choose conservative initialization) A value of 0.2 is prioritized to ensure training stability.
[0050] When the background of the material image is clean and the target is prominent, or when the pre-trained model used already has strong feature extraction capabilities, it can be subjected to high-intensity enhancements from the beginning to maximize the robustness of the model.
[0051] If the model's loss decreases rapidly on the training set but stagnates on the validation set, it indicates that the model is prone to overfitting. In this case, aggressive initialization can increase the learning difficulty from the beginning, forcing the model to learn more generalized features.
[0052] Furthermore, the global enhancement strength control factor The value range is set to [0,1].
[0053] In this way, the present invention realizes the automatic configuration of training parameters based on a data-driven method, which improves the efficiency and final performance of model training, while avoiding the subjectivity and tediousness of manual parameter tuning.
[0054] S3, Execute the training loop, which includes: S30, use Data augmentation is performed on images in the training dataset, and the augmentation operation includes at least one of rotation, brightness adjustment, contrast adjustment, and noise addition.
[0055] Using the original image data Xoriginal from the training dataset as input, and utilizing the global enhancement intensity control factor... This controls the intensity of the enhancement transformation, generating the enhanced image data Xaugmented. Specific enhancement operations may include, but are not limited to, rotation, scaling, brightness adjustment, and noise addition, with the intensity of each operation being proportional to... Proportional.
[0056] (1) Rotation operation: Define the basic maximum rotation angle as (For example ).
[0057] The actual rotation angle when applying a rotation operation each time. It is generated by a random function, but its maximum amplitude is affected by... Control, the calculation formula is: ; The actual rotation angle of the final application. The preset maximum rotation angle is a constant. : indicates generating a value in the interval A random number that is uniformly distributed within the range. When When, no rotation occurs; when At that time, Internal random rotation.
[0058] (2) Scaling operation: Define the base maximum scaling factor as (e.g., 0.2).
[0059] The actual scaling factor when each scaling operation is applied. The calculation formula is: ; The actual scaling factor of the final application (1.0 represents the original size).
[0060] The preset base maximum scaling perturbation amplitude is a constant.
[0061] when hour, No scaling is applied; when At that time, Internal random scaling.
[0062] (3) Brightness adjustment operation: Define the range of values for image pixel values as follows: (For example, for an 8-bit image, ).
[0063] Define the base maximum brightness adjustment factor as (e.g., 0.5).
[0064] Then add brightness adjustment value to the entire image The calculation formula is: ; The final brightness adjustment value applied to every pixel of the entire image.
[0065] The maximum value of an image pixel is a constant.
[0066] The preset maximum brightness adjustment range is a constant.
[0067] when hour, Do not adjust brightness; when At that time, The brightness is adjusted randomly within the device.
[0068] (4) Adding noise operation: Define the basic noise intensity as (For example, 0.05 times the standard deviation of the corresponding pixel value).
[0069] The actual standard deviation of the added noise The calculation formula is: ; Subsequently, from a mean of 0 and a standard deviation of The image is sampled from a Gaussian distribution to generate a noise matrix of the same size as the image, which is then superimposed on the original image.
[0070] The actual standard deviation of the added high noise.
[0071] The preset base noise intensity coefficient is a constant.
[0072] The maximum value of an image pixel is a constant.
[0073] when hour, No noise is added; When adding standard deviation, The noise.
[0074] In summary, this specific implementation method controls the global enhancement strength factor. By multiplying the basic parameters of each enhancement operation, the enhancement intensity and... The direct proportionality. This scheme ensures the mathematical continuity and controllability of the enhancement operation, making... The growth of this technology can smoothly and linearly increase the intensity and diversity of visual changes in data augmentation, thus providing a precise control basis for adaptive adjustments based on training dynamics.
[0075] S31, input the enhanced image into the material recognition model, calculate the loss, and update the weight parameters of the material recognition model.
[0076] The enhanced image data Xaugmented is input into the material recognition model to obtain the model's predicted output Ypred. Based on the model's predicted output Ypred and the true label Ytrue, the loss value L for the current batch is calculated.
[0077] Calculate the loss value L with respect to the model weight parameters. The gradient is calculated, and the model's weight parameters are updated using optimization algorithms (such as stochastic gradient descent). .
[0078] S32, calculates the training dynamic indicators.
[0079] Store the training dynamic index I of the current batch into the cache queue Q. The training dynamic index I can be selected from any of the following: I=L, which is the loss value of the current batch; That is, the gradient norm of the current batch loss function with respect to the model weights; I = max(softmax(Ypred)), that is, the maximum confidence of the model's predicted output.
[0080] S33, periodically adjust the value of dynamically according to the comparison result between the training dynamic metric and the target threshold.
[0081] After each K training batches are iterated, perform an adjustment of the enhancement strength control factor as follows: S310: Calculate the recent performance metric. Obtain the training dynamic metrics of the last K batches from the cache queue Q, and calculate their arithmetic mean, denoted as the average training dynamic metric Iavg. For example, the value of K is 10.
[0082] S320: Adjust according to a predetermined strategy. Compare Iavg with the preset target threshold Itarget, and update the global enhancement strength control factor as follows: If the training dynamic metric I is a loss value or a gradient norm, and Iavg < Itarget, then update as follows: ; If the training dynamic metric I is a loss value or a gradient norm, and Iavg ≥ Itarget, then update as follows: ; If the training dynamic metric I is the model's prediction confidence, and Iavg > Itarget, then update as follows: ; If Iavg ≤ Itarget, then update as follows: ; Among them, and are preset learning rate coefficients (for example, 0.1 and 0.05 respectively), which are used to control the adjustment amplitude of .
[0083] If the training dynamic metric I is a loss value, the target threshold can be 0.5. If the training dynamic metric I is a gradient norm, the target threshold can be 1. If the training dynamic metric I is the maximum confidence, the target threshold can be 0.9.
[0084] S34. Repeat S30 to S33 until the training termination condition is met. After training ends, output the trained material recognition model.
[0085] Specific training conditions include a total number of training iterations greater than a preset number of iterations T. For example, T is 100.
[0086] S4 uses the trained material recognition model to manage materials.
[0087] For example, the trained material recognition model can be deployed to an image recognition device for material entry into the warehouse, and the materials can be classified based on the recognition results.
[0088] Example 2: refer to Figure 2 The present invention also provides a material management system, including a data acquisition module, an initialization module, a training module, and a management module; The acquisition module is used to collect material images in material management scenarios and build a training dataset; The initialization module is used to initialize the weight parameters of the material recognition model and a global enhancement control factor. ; The training module is used to execute training loops, which include: S30, use Data augmentation is performed on images in the training dataset, and the augmentation operation includes at least one of rotation, brightness adjustment, contrast adjustment, and noise addition. S31, input the enhanced image into the material recognition model, calculate the loss and update the weight parameters of the material recognition model; S32, calculates training dynamic indicators; S33, periodically adjust the dynamic values based on the comparison results between the training dynamic indicators and the target threshold. The value; S34, repeat S30 to S33 until the training termination condition is met. After training ends, output the final material identification model. The management module is used to manage materials using the trained material recognition model.
[0089] Example 3: refer to Figure 3 The present invention also provides a computer device, the computer device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the steps of the above-described material management method.
[0090] Example 4: The present invention also provides a computer-readable storage medium having a computer program stored thereon, characterized in that the computer program, when executed by a processor, implements the steps of the above-described material management method.
[0091] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A material management method, characterized in that, include: S1, Collect material images in material management scenarios and build a training dataset; S2, Initialize the weight parameters of the material recognition model and a global enhancement control factor. ; S3, Execute the training loop, which includes: S30, use Data augmentation is performed on images in the training dataset, and the augmentation operation includes at least one of rotation, brightness adjustment, contrast adjustment, and noise addition. S31, input the enhanced image into the material recognition model, calculate the loss and update the weight parameters of the material recognition model; S32, calculates training dynamic indicators; S33, periodically adjust the dynamic values based on the comparison results between the training dynamic indicators and the target threshold. The value; S34, repeat S30 to S33 until the training termination condition is met. After training ends, output the trained material recognition model. S4 uses the trained material recognition model to manage materials.
2. The material management method according to claim 1, characterized in that, S1 includes: S10, Obtain material images from a preset material management scenario; S11, preprocess each material image to obtain the processed image; S12 calculates the similarity between processed images and constructs a training dataset based on the similarity.
3. The material management method according to claim 2, characterized in that, The preset material management scenarios include material classification, material inventory, and material outbound detection.
4. A material management method according to claim 2, characterized in that, S11 includes: The material image is converted to grayscale to obtain a grayscale image; A filtering algorithm is used to filter the grayscale image to obtain the processed image.
5. A material management method according to claim 2, characterized in that, Calculating the similarity between processed images includes: Calculate the pairwise similarity between the processed images corresponding to all material images obtained in the same material management scenario.
6. A material management method according to claim 5, characterized in that, The construction of the training dataset based on similarity includes: Store all processed images into set U; For each similarity, the following processing is performed: For the obtained similarity sim, the two processed images corresponding to sim are represented as p1 and p2 respectively; If sim is greater than the set similarity threshold, then p1 or p2 will be removed from set U; The training dataset consists of the remaining processed images in set U.
7. A material management method according to claim 1, characterized in that, Global enhancement strength control factor Initialization includes: S21, calculates the complexity metric based on the training dataset; S22, Based on the complexity metric, select one initialization scheme from multiple preset initialization schemes to control the global enhancement strength factor. Perform initialization.
8. A material management system, characterized in that, It includes a data acquisition module, an initialization module, a training module, and a management module; The acquisition module is used to collect material images in material management scenarios and build a training dataset; The initialization module is used to initialize the weight parameters of the material recognition model and a global enhancement control factor. ; The training module is used to execute training loops, which include: S30, use Data augmentation is performed on images in the training dataset, and the augmentation operation includes at least one of rotation, brightness adjustment, contrast adjustment, and noise addition. S31, input the enhanced image into the material recognition model, calculate the loss and update the weight parameters of the material recognition model; S32, calculates training dynamic indicators; S33, periodically adjust the dynamic values based on the comparison results between the training dynamic indicators and the target threshold. The value; S34, repeat S30 to S33 until the training termination condition is met. After training ends, output the final material identification model. The management module is used to manage materials using the trained material recognition model.
9. A computer device, the computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor, when executing the computer program, implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.