Image denoising method, device and medium for machine vision

By determining the center trend and threshold of the grayscale value of the image data in machine vision and adjusting the standardized coefficient of the training sample, the impact of image light and darkness on model accuracy is solved, and the effect of reducing model complexity and computing power occupation is achieved, and the effect of improving the Automation efficiency of image data processing.

CN118710536BActive Publication Date: 2024-11-15INSPUR GENERSOFT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411204192.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-11-15
Estimated Expiration
2044-08-30

AI Technical Summary

Technical Problem

In machine vision, the difference in image light and darkness has a significant impact on model accuracy. Traditional solutions require the acquisition of multiple light and darkness images for training, which increases the complexity of the model and the use of computing resources, and it is difficult to completely cover all data sets.

Method used

By collecting image data, generating training samples, determining the center trend of grayscale value and image noise reduction threshold, adjusting the grayscale value based on the standardized coefficient, realizing image noise reduction and reducing the impact of light and darkness characteristics on the model.

Benefits of technology

It reduces the complexity of the model, computing power occupation and training costs, realizes the automation of image data processing, reduces the workload of manual marking, and improves processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118710536B_ABST
    Figure CN118710536B_ABST
Patent Text Reader

Abstract

The present application discloses an image denoising method, device and medium for machine vision, which relates to the field of image preprocessing. The method includes: selecting at least part of the samples in the training samples as designated samples; determining the corresponding grayscale value central trend according to the grayscale value of each designated sample; determining the corresponding image denoising threshold based on the application scenario of the image data; for a single training sample, determining the standardization coefficient of the training sample according to the grayscale value and the grayscale value central trend of the training sample; if the standardization coefficient reaches the image denoising threshold, adjusting the grayscale value of the training sample based on the grayscale value central trend, so as to perform image denoising on the training samples. By reducing the brightness and darkness characteristics, the complexity of the model, computing power occupation, training and use costs are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image preprocessing, and in particular to an image denoising method, device and medium for machine vision. Background Art

[0002] Machine Vision mainly automates visual tasks through image processing and analysis. It is an intersection of computer science, image processing, artificial intelligence and other fields, and is used to enable computers to perceive and process visual data.

[0003] Machine vision is widely used in industrial defect recognition and detection scenarios, but when training, verifying, testing and applying models, the difference in image brightness will have a significant impact on the accuracy of the model. In most industrial defect recognition and detection scenarios, the brightness of the image is caused by changes in the external environment such as the acquisition time, whether the light is on, and whether it is sunny or cloudy. From the perspective of model training, the brightness of the image is noise and is not a feature to be concerned about.

[0004] In traditional solutions, in order to eliminate the impact of image brightness characteristics on model accuracy, when training machine vision models, it is often necessary to collect images with different brightness levels and use the brightness level as one of the model's features for training.

[0005] Although the impact of image brightness features on model accuracy can be reduced to a certain extent, it is still difficult to eliminate the impact on model accuracy if the collected images cannot cover all data sets of brightness levels. In addition, adding image brightness features increases the complexity of the model and also increases the computing power resources occupied and cost during model training. Summary of the invention

[0006] In order to solve the above problems, this application proposes an image denoising method for machine vision, including:

[0007] Collecting image data, generating training samples according to the image data, and selecting at least part of the samples from the training samples as designated samples;

[0008] According to the gray value of each specified sample, determine the corresponding gray value central trend;

[0009] Determining a corresponding image noise reduction threshold based on an application scenario of the image data;

[0010] For a single training sample, determining a standardization coefficient of the training sample according to the gray value of the training sample and the central trend of the gray value;

[0011] If the normalization coefficient reaches the image denoising threshold, the grayscale values ​​of the training samples are adjusted based on the central trend of the grayscale values ​​to perform image denoising on the training samples.

[0012] On the other hand, the present application also proposes an image denoising device for machine vision, comprising:

[0013] at least one processor; and,

[0014] a memory communicatively connected to the at least one processor; wherein,

[0015] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the image denoising method for machine vision as described in the above example.

[0016] On the other hand, the present application also proposes a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured as: the image denoising method for machine vision described in the above example.

[0017] The image denoising method for machine vision proposed in this application can bring the following beneficial effects:

[0018] By reducing the brightness and darkness characteristics, the complexity of the model, computing power usage, training and usage costs are reduced; at the same time, in order to eliminate the influence of the brightness and darkness characteristics of the image, the data preprocessing work carried out does not require tedious workload and human resources such as manual labeling. Relying on fixed algorithms, the image data processing process can be automated, which is efficient and easy to implement. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0020] Figure 1 A schematic diagram of a process flow of an image denoising method for machine vision in an embodiment of the present application;

[0021] Figure 2 A schematic diagram of an image denoising method for machine vision in one scenario in an embodiment of the present application;

[0022] Figure 3 Schematic diagram of an image denoising device for machine vision in an embodiment of the present application. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0024] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0025] like Figure 1 and Figure 2 As shown, the embodiment of the present application provides an image denoising method for machine vision, comprising:

[0026] S101: Collect image data, generate training samples according to the image data, and select at least part of the training samples as designated samples.

[0027] Image data is collected using CCD cameras, CMOS cameras and other devices, and training samples are generated from the collected image data. The training sample set is divided into a training set, a validation set and a test set. For the convenience of description, the sample capacities of the training set, validation set and test set are denoted as α, β and γ, respectively.

[0028] The higher the number of samples, the higher the proportion of the training set. For example, for a small-scale image dataset, the validation set and the test set have a slightly larger proportion, and you can choose α:β:γ to be 6:2:2 or 8:1:1, where the ratio of 6:2:2 means that 60% of the data is used for training, 20% for validation, and 20% for testing; for a large-scale image dataset, the ratio can be more biased towards the training set, and α:β:γ can be selected to be 98:1:1 or 99.5:0.3:0.2, etc.

[0029] For example, in the application scenario of clothing washing label quality inspection (label damage or scratch identification, language identification, plate identification, batch number identification, etc.), model training is carried out for specific users and batches of washing labels. The image data set is often small (the number is usually within 10,000), and the ratio of training set, verification set and test set is set to 6:2:2. Of course, application scenarios can also include cloth printing and dyeing quality inspection (missing printing, offset printing, sand holes, etc.), assembly anomaly identification (missing or wrong installation, etc.), workshop behavior identification (not wearing a helmet or work clothes), etc., which can be set based on actual conditions.

[0030] After obtaining the training samples, it is necessary to determine the brightness of the batch of training samples, so as to determine whether the brightness of each training sample will affect the training process of the machine vision model. When the amount of data in the training sample set is large, selecting all the training samples may result in too much computing power consumption, so at least some samples can be randomly selected from the training samples based on the Monte Carlo method as designated samples.

[0031] The higher the number of samples, the lower the percentage of the selected samples. Based on the Monte Carlo method, all or part of the image samples in the training set are randomly selected to calculate the brightness of the training samples. Here, the randomly selected sample capacity is recorded as ,in For small-scale datasets, a larger proportion of the dataset can be selected to ensure that the distribution of the selected image samples is consistent with that of the entire dataset, such as :α>50%; for large-scale data sets, a smaller proportion can be selected, such as :α=10% to reduce the amount of calculation in the data preprocessing stage.

[0032] For example, in application scenarios such as clothing washing label quality inspection (label damage or scratch identification, language recognition, plate recognition, batch number recognition, etc.), the image data set is often not large in scale, and the sample capacity is selected as 60% of the entire data set, which can not only ensure the accuracy of the model, but also appropriately reduce the computing power resource usage and cost of model training.

[0033] S102: Determine the corresponding gray value central trend according to the gray value of each designated sample.

[0034] Determine the grayscale value corresponding to each specified sample, and then determine the grayscale value central trend based on the distribution of the grayscale values ​​of all specified samples. The grayscale value central trend refers to the central trend of the grayscale values ​​of all training samples reflected by the central trend of the grayscale values ​​of the specified samples (which can be reflected by the mean, median, grayscale histogram, etc.).

[0035] Specifically, first, for each designated sample, the corresponding grayscale value mean is determined. For a single designated sample, all the pixels contained in it are determined. It is assumed that the i-th designated sample has a total of n pixels. For each pixel, based on its pixel value in each channel, the grayscale value of the pixel is obtained by weighted average.

[0036] Here, we take the image data through RGB mode as an example to explain, at this time, calculate the selected The average RGB grayscale value of a single specified sample among the specified samples, where the average RGB grayscale value of the jth pixel of the i-th specified sample is , is the mean value obtained by weighted averaging of channels R, G and B. Assuming that the weights of channels R, G and B are the same, it is as shown in formula (1):

[0037] i=1,2,3…… , j=1,2,3……nFormula (1).

[0038] According to the gray value mean of all pixels, the gray value mean of a single specified sample can be calculated. The RGB gray value mean of the i-th specified sample is , that is, specify the sample i All n The average RGB grayscale value of each pixel is as shown in formula (2):

[0039] i=1,2,3…… Formula (2).

[0040] At this time, as shown in formula (3), based on the gray value mean of all specified samples, the corresponding mean median is determined and the selected The median of the mean RGB grayscale values ​​of the specified samples , as the central trend of the grayscale values ​​corresponding to the designated sample and the training sample, so that the central trend of the grayscale values ​​of the training sample is represented by the designated sample.

[0041] = i=1,2,3…… Formula (3).

[0042] Of course, based on the needs, the average value of the gray value means of all specified samples can be selected as the central trend of the gray value corresponding to the specified sample and the training sample.

[0043] Furthermore, when calculating the mean grayscale value corresponding to a single specified sample, the method of calculating the mean value as shown in formula (2) may be too simple and crude in actual implementation. For some image data with particularly large changes in brightness and darkness, it is difficult to express the brightness and darkness through the mean value. Therefore, other methods can be used instead.

[0044] At this time, the image size of the specified sample and the grayscale histogram of the specified sample are determined. The grayscale histogram is a function of grayscale distribution and is a statistic of grayscale distribution in the image.

[0045] Based on the image size, the corresponding distance interval threshold is determined; the larger the image size, the higher the distance interval threshold. Based on the grayscale histogram, the maximum interval distance between its peaks is determined. The peak value can be defined by fitting the height vertices of each grayscale value of the grayscale histogram to obtain a curve, and then the curve is derived to obtain the extreme value, and then the peak value is selected from the extreme values ​​(for example, if the distance between two extreme values ​​is very close, the higher extreme value is selected as the peak value).

[0046] If the maximum interval distance is higher than the distance interval threshold, it is considered that the brightness difference in the image data is large, that is, there are a large number of pixels with very low grayscale values ​​and a large number of pixels with very high grayscale values ​​at the same time, and it is not suitable to adopt the averaging method.

[0047] Continue to judge. If the image size is higher than the preset image size threshold (which is usually higher than the minimum required size of the machine vision model for the input image), the image size is considered to be large, and the specified sample can be cropped. For example, multiple rounds of image cropping are performed from the edge to remove the edges of some images where the difference in brightness between the edge and the center area is too obvious due to shooting factors, until the image size reaches the image size threshold. At this time, even if the maximum interval distance is still higher than the distance interval threshold, it will no longer be cropped. Of course, if the maximum interval distance between the peaks of the grayscale histogram of the cropped specified sample is lower than the distance interval threshold, the cropping is stopped and it is used as a training sample.

[0048] If the maximum interval distance is higher than the distance interval threshold, and the image size is lower than the preset image size threshold, it is considered that cropping is likely to lose important information in the image. In this case, pooling is performed on the specified samples. The pooling process here is not to reduce the image size, but to use the average value, maximum value, or minimum value of the pixel values ​​in a fixed pixel range (for example, a 2*2 pixel range) in the image data as the grayscale value of all pixel values ​​in the fixed pixel range, thereby performing pooling to reduce the information contained in the image data and reduce the difference in brightness.

[0049] The pooling process is stopped until the number of pooling times reaches the preset pooling times threshold, or the maximum interval distance between the peaks of the grayscale histogram of the specified sample after pooling is lower than the distance interval threshold. At this time, the pooling is also stopped and it is used as a training sample.

[0050] At this point, the grayscale values ​​of all pixels of the specified sample after cropping or pooling can be averaged to obtain the grayscale value mean corresponding to the specified sample.

[0051] S103: Determine a corresponding image noise reduction threshold based on an application scenario of the image data.

[0052] For different application scenarios, the corresponding image denoising threshold is set, and its specific value depends on the requirements of the application scenario and the degree of impact on the accuracy of the machine vision model.

[0053] For example, in the application scenario of clothing washing label quality inspection (label damage or scratch recognition, language recognition, plate recognition, batch number recognition, etc.), the brightness of the image has an impact on the model accuracy, but it is not decisive. In this case, the image denoising threshold is set to ±30%, that is, accepting images with RGB thresholds fluctuating 30% above and below. When it exceeds 30%, the image RGB is normalized.

[0054] S104: For a single training sample, determine a standardization coefficient of the training sample according to the grayscale value of the training sample and the central trend of the grayscale value.

[0055] For a single training sample, the grayscale value of the training sample is divided by the mean median to obtain the standardization coefficient of the training sample. As shown in formula (4), the standardization coefficient of training sample i is calculated as , the standardized coefficient represents the difference between the training sample and the mean median.

[0056] Formula (4).

[0057] S105: If the normalization coefficient reaches the image denoising threshold, grayscale values ​​of the training samples are adjusted based on the grayscale value central trend, so as to perform image denoising on the training samples.

[0058] When the normalization coefficient of a training sample reaches the image denoising threshold, it is considered that the image brightness of the training sample has a non-negligible impact on the model accuracy, and the image RGB is normalized. Otherwise, the RGB of the image sample remains unchanged.

[0059] When the image RGB is normalized, it can be As the standard value of brightness for the training set, validation set, and test set, for each pixel in the training sample, the grayscale value of the pixel is adjusted based on the mean median. For example, the RGB mean of the standardized training sample i is equal , as shown in formula (5).

[0060] Formula (5).

[0061] At this time, for the jth pixel in image sample i, its standardized As shown in formula (6).

[0062] Formula (6).

[0063] Of course, this standardization method is still relatively simple and crude, and it is difficult to reflect the relevant information originally contained in the image data, which is easy to cause information loss. At this time, for each pixel point in the training sample, the numerical difference between it and the mean median can be determined.

[0064] If the numerical difference is lower than the preset grayscale difference, the pixel is considered to be close to the mean median, and the grayscale value of the pixel is adjusted to the pixel value corresponding to the mean median, at which time less information is lost.

[0065] If the numerical difference is higher than the preset grayscale difference, the mean median is numerically adjusted based on the numerical difference, and the mean median after numerical adjustment is used as the grayscale value of the pixel point, thereby adjusting the grayscale value of the pixel point while reducing the lost information.

[0066] The higher the value difference, the higher the value adjustment, and the value difference and the value adjustment are in a step function relationship. For example, when the value difference is higher than one preset grayscale difference and lower than two preset grayscale differences, the mean median is adjusted (including increase or decrease, which is determined by the positive or negative value of the value difference) by a fixed value, when the data difference is higher than two preset grayscale differences and lower than three preset grayscale differences, the mean median is adjusted by two fixed values, and so on.

[0067] By reducing the brightness and darkness characteristics, the complexity of the model, computing power usage, training and usage costs are reduced; at the same time, in order to eliminate the influence of the brightness and darkness characteristics of the image, the data preprocessing work carried out does not require tedious workload and human resources such as manual labeling. Relying on fixed algorithms, the image data processing process can be automated, which is efficient and easy to implement.

[0068] In one embodiment, for a machine vision model, a corresponding image input type is determined.

[0069] If the image input type is a color image, then for each pixel, based on its pixel value in each channel, the grayscale value of the pixel is obtained by weighted average, that is, the grayscale values ​​of the three channels, R channel, G channel and B channel, are calculated respectively using formula (1) to formula (6).

[0070] If the image input type is a grayscale image, the image data is grayed out, and then the grayscale value mean corresponding to the specified sample is obtained based on the grayscale values ​​of all pixels. For machine vision models trained with grayscale images, the R channel, G channel, and B channel are the same. The average method, weighted average method, maximum method, etc. can be used to transform the color image into a grayscale image before calculating formula (1), and then use formulas (2) to (6) in sequence to perform subsequent RGB standardization steps.

[0071] Among them, for the average value method, the grayscaled R=grayscaled G=grayscaled B=(R before processing + G before processing + B before processing) / 3; for the weighted average value method, the grayscaled R=grayscaled G=grayscaled B=R before processing*0.3+G before processing*0.59+B before processing*0.11; for the maximum value method, the grayscaled R=grayscaled G=grayscaled B=max(R before processing, G before processing, B before processing).

[0072] In one embodiment, RGB standardized image data is used for model training, verification and testing. If the model parameters (including but not limited to accuracy, precision, recall and F1 score, etc.) meet the requirements, the application can be deployed. If they do not meet the requirements, adjustments and optimizations are made based on the performance of the model parameters, including but not limited to the adjustment of the selection ratio of the training set, verification set and test set data, and the adjustment of the model hyperparameters.

[0073] Take model adjustment as an example. For example, if the model cannot meet the requirements, it may be related to the selection ratio of the training set and the distribution of the selected samples. You can return to the step of training set selection to optimize the model, including but not limited to reselecting samples and changing the selection ratio.

[0074] When the model is applied, the image to be identified or tested needs to be subjected to brightness noise reduction according to the above steps before the model is used for identification or detection. For application scenarios of clothing washing label quality inspection (label damage or scratch identification, language identification, plate identification, batch number identification, etc.), the brightness of the label image can be standardized, so as to brighten or dim it, which is convenient for label quality inspection.

[0075] like Figure 3 As shown, the embodiment of the present application also proposes an image noise reduction device for machine vision, including:

[0076] at least one processor; and,

[0077] a memory communicatively connected to the at least one processor; wherein,

[0078] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the image denoising method for machine vision as described in any of the above embodiments.

[0079] On the other hand, the present application also proposes a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured as: the image denoising method for machine vision described in the above example.

[0080] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0081] The devices and media provided in the embodiments of the present application correspond one-to-one to the methods. Therefore, the devices and media also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.

[0082] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0083] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0084] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0085] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0086] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0087] Memory may include non-permanent storage in a computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0088] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0089] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0090] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A method for image denoising for machine vision, characterized in that: include: Collecting image data, generating training samples according to the image data, and selecting at least part of the samples from the training samples as designated samples; According to the gray value of each specified sample, determine the corresponding gray value central trend; Determining a corresponding image noise reduction threshold based on an application scenario of the image data; For a single training sample, determining a standardization coefficient of the training sample according to the gray value of the training sample and the central trend of the gray value; If the normalization coefficient reaches the image denoising threshold, adjusting the grayscale value of the training sample based on the central trend of the grayscale value to perform image denoising on the training sample; According to the gray value of each specified sample, the corresponding gray value central trend is determined, which also includes: For the specified sample, determine the grayscale value mean corresponding to the specified sample; Based on the grayscale value means of all designated samples, the corresponding median of the means is determined as the central trend of the grayscale values ​​corresponding to the designated samples and the training samples; For the specified sample, determining the grayscale value mean corresponding to the specified sample includes: For the specified sample, determine all the pixels contained in it; For each pixel, based on its pixel value in each channel, the grayscale value of the pixel is obtained by weighted average; According to the grayscale values ​​of all pixels, the mean grayscale value corresponding to the specified sample is obtained; According to the grayscale values ​​of all pixels, the mean grayscale value corresponding to the specified sample is obtained, specifically including: Determine the image size of the specified sample and the grayscale histogram of the specified sample; Based on the image size, determining a distance interval threshold value corresponding to each peak value; wherein the larger the image size, the higher the distance interval threshold value; Based on the grayscale histogram, determining the maximum interval distance between peaks thereof; If the maximum interval distance is higher than the distance interval threshold, and the image size is higher than a preset image size threshold, the designated sample is cropped until the image size reaches the image size threshold, or the maximum interval distance between peaks of the grayscale histogram of the designated sample after cropping is lower than the distance interval threshold; If the maximum interval distance is higher than the distance interval threshold and the image size is lower than the preset image size threshold, the designated sample is pooled until the number of pooling times reaches the preset pooling times threshold, or the maximum interval distance between the peaks of the grayscale histogram of the designated sample after pooling is lower than the distance interval threshold; For the designated sample after cropping or pooling, the grayscale values ​​of all pixels are averaged to obtain the grayscale value mean corresponding to the designated sample.

2. The method according to claim 1, characterized in that For a single training sample, according to the gray value of the training sample and the central trend of the gray value, a standardization coefficient of the training sample is determined, specifically including: For a single training sample, dividing the grayscale value of the training sample by the mean median to obtain a standardization coefficient of the training sample; Adjusting the grayscale value of the training sample based on the grayscale value central trend specifically includes: For each pixel in the training sample, the grayscale value of the pixel is adjusted based on the mean median.

3. The method according to claim 2, characterized in that For each pixel in the training sample, adjusting the grayscale value of the pixel based on the mean median specifically includes: For each pixel in the training sample, determine the numerical difference between the pixel and the mean median; If the numerical difference is lower than the preset grayscale difference, the grayscale value of the pixel point is adjusted to the pixel value corresponding to the mean median; If the numerical difference is higher than the preset grayscale difference, the mean median is numerically adjusted based on the numerical difference, and the mean median after numerical adjustment is used as the grayscale value of the pixel point; wherein, the higher the numerical difference, the higher the numerical adjustment, and the numerical difference and the numerical adjustment are in a step function relationship.

4. The method according to claim 1, characterized in that: Before determining the grayscale value mean corresponding to the specified sample, the method further includes: For the machine vision model, determine the corresponding image input type; If the image input type is a color image, then for each pixel, based on its pixel value in each channel, a grayscale value of the pixel is obtained by weighted average; If the image input type is a grayscale image, after the image data is grayscaled, the mean grayscale value corresponding to the specified sample is obtained according to the grayscale values ​​of all pixels.

5. The method according to claim 1, characterized in that Collecting image data, generating training samples according to the image data, and selecting at least part of the samples from the training samples as designated samples, specifically includes: Collecting image data, generating training samples according to the image data, and dividing the training samples into a training set, a validation set, and a test set based on the number of samples of the training samples; wherein the higher the number of samples, the higher the proportion of the training set; Based on the Monte Carlo method, at least part of the samples are randomly selected from the training samples as designated samples; wherein, the higher the number of samples is, the lower the proportion of the selected designated samples is.

6. An image denoising device for machine vision, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the image denoising method for machine vision as described in any one of claims 1 to 5.

7. A non-volatile computer storage medium storing computer executable instructions, characterized in that: The computer executable instructions are configured as: an image denoising method for machine vision as described in any one of claims 1 to 5.