System and method for predicting optical effect of image
By constructing and training the light effect prediction model, using the optical parameters of the visual detection equipment to predict image quality, the problem of inaccurate prediction of image optical quality in the prior art is solved, and automated, fast and accurate optical effect evaluation and early warning are achieved.
Patent Information
- Application Number
- CN202411945314.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-18
AI Technical Summary
The prior art cannot accurately predict the optical quality of images, which makes it difficult to warning for abnormal optical parameters that may occur in production line visual detection equipment, which may cause safety risks or quality problems.
By obtaining the optical parameters of the visual detection device, pre-screening process is performed to obtain the final feature variable, an initial light effect prediction model is constructed, and the optimal light effect prediction model is obtained through mapping training, which is used to predict image quality scores, thereby measuring image optical effect.
Automatic prediction of image optical effects is realized, the subjectivity of manual operation is avoided, and the prediction results of image optical effects can be obtained quickly and accurately, greatly improving the efficiency and accuracy of evaluation, and providing online early warning and light effect adjustment suggestions.
Smart Images

Figure CN119850566A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a system and method for predicting image optical effects. Background Art
[0002] Currently, related technologies such as deep learning defect detection or traditional visual defect detection usually need to rely on manual evaluation of images to judge the algorithm model's defect detection ability, which has the defect of strong subjectivity.
[0003] Moreover, when the performance indicators of the light source, camera, lens parameters, mechanical positioning, and motion control of the visual inspection equipment in the current production line are abnormal, it is generally difficult to warn of the image quality. By the time personnel discover problems with image quality, mass production may have been completed. If the products flow into downstream factories, it may cause safety risks or serious quality problems. In particular, in areas where production lines such as new energy lithium battery production lines, biopharmaceutical manufacturing, automobile and parts manufacturing have extremely high safety requirements, upstream strict control of incoming materials is required.
[0004] Therefore, there is an urgent need for a method that can ensure that the optical quality of an image can be accurately identified within an appropriate range. Summary of the invention
[0005] The purpose of the embodiments of the present invention is to provide a system and method for predicting the optical effect of an image, so as to solve the problem in the prior art that the optical quality of an image cannot be accurately predicted within an appropriate range.
[0006] To achieve the above object, an embodiment of the present invention provides a method for predicting the optical effect of an image, and the method specifically includes:
[0007] Acquiring optical parameters of a visual inspection device, performing a pre-screening process on the optical parameters, and obtaining final characteristic variables;
[0008] Constructing an initial light effect prediction model, taking the final feature variable as input of the initial light effect prediction model, and performing mapping training on the final feature variable and the image quality score to obtain an optimal light effect prediction model;
[0009] The target characteristic variables corresponding to the optical parameters of the device to be detected are input into the optimal light effect prediction model to obtain the image quality score corresponding to the optical parameters of the device to be detected, and the image optical effect of the device to be detected is measured based on the image quality score.
[0010] On the basis of the above technical solution, the present invention can also be improved as follows:
[0011] Furthermore, the obtaining of optical parameters of the visual inspection device and pre-screening of the optical parameters to obtain final characteristic variables include:
[0012] Extracting a plurality of original characteristic variables based on the optical parameters;
[0013] Calculating correlation coefficients of a plurality of the original feature variables corresponding to the prediction of the image optical effect;
[0014] The original feature variables whose correlation coefficients exceed the preset standard range are extracted as the final feature variables.
[0015] Furthermore, the final characteristic variables include the brightness of each light source, the angle between the light source and the camera relative to the workpiece, the distance between the light source and the camera relative to the workpiece, the lens aperture, the lens focal length, the camera pixel accuracy, the light source wavelength and color spectrum and the camera frame rate.
[0016] Furthermore, the constructing of the initial light effect prediction model further includes:
[0017] Construct an initial light effect prediction model based on a multi-layer perceptron neural network;
[0018] The initial light effect prediction model includes an input layer, a hidden layer and an output layer. The feature dimension of the input layer is consistent with the number of parameter types. The number of hidden layers is two or more. When the number of hidden layers is two, the number of hidden layers is recorded as A layer and B layer respectively. The number of neurons in the A layer is m, and the number of neurons in the B layer is h, where m and h are non-specific variables.
[0019] The final feature variable is received through the input layer, feature extraction, conversion, nonlinear mapping and information integration are performed on the final feature variable through the hidden layer, and the image quality score is output through the output layer.
[0020] Furthermore, the constructing of the initial light effect prediction model further includes:
[0021] An initial light efficiency prediction model is constructed based on the support vector regression method. During the mapping training process, different optical parameters are used as inputs of the initial light efficiency prediction model and mapped to a high-dimensional space to regress the quality score. The initial light efficiency prediction model is optimized using an optimization strategy that maximizes the width of the interval band and minimizes the total loss to obtain the optimal light efficiency prediction model.
[0022] Furthermore, the constructing of the initial light effect prediction model further includes:
[0023] Build an optimal light effect prediction model based on the improved Transformer network;
[0024] The improved Transformer network cancels the link of aligning the position encoder and the embedded data, retains the Encoder module or the Decoder module, uses the final feature variable as the input of the initial light effect prediction model, and converts the final feature variable into a probability form through linear decomposition to obtain an image quality score.
[0025] Furthermore, the method for predicting the optical effect of an image further includes:
[0026] Determining whether the image quality meets the standard based on the image optical effect prediction, and generating warning information when the image quality does not meet the standard;
[0027] When the image quality does not meet the standard, the type of image quality that does not meet the standard is determined based on the image optical effect prediction, and a corresponding processing plan is determined based on the type of image quality that does not meet the standard. The processing plan is sent to the corresponding processing personnel user end, and the processing personnel take processing measures based on the processing plan.
[0028] A system for predicting optical effects of an image, comprising:
[0029] A preprocessing module, used to obtain optical parameters of the visual inspection equipment, perform pre-screening processing on the optical parameters, and obtain final characteristic variables;
[0030] A construction module, used to construct an initial light effect prediction model, use the final feature variable as the input of the initial light effect prediction model, and perform mapping training between the final feature variable and the image quality score to obtain an optimal light effect prediction model;
[0031] The prediction module is used to input the target characteristic variables corresponding to the optical parameters of the device to be detected into the optimal light effect prediction model, obtain the image quality score corresponding to the optical parameters of the device to be detected, and measure the image optical effect of the device to be detected based on the image quality score.
[0032] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the steps of the method are implemented when the processor executes the computer program.
[0033] A non-transitory computer-readable storage medium stores a computer program, which implements the steps of the method when executed by a processor.
[0034] The embodiments of the present invention have the following advantages:
[0035] The method for predicting the optical effect of an image in the present invention obtains the optical parameters of the visual detection equipment and constructs a light effect prediction model, thereby realizing automatic prediction of the optical effect of the image, avoiding the uncertainty of manual operation, and being able to quickly and accurately obtain the prediction results of the optical effect of the image, greatly improving the efficiency and accuracy of the evaluation.
[0036] The method for predicting the optical effect of an image in the present invention provides a standardized evaluation method by processing optical parameters and constructing an initial light effect prediction model. It can transform the complex method of evaluating optical image quality failure failures in products, which was originally performed by optical and algorithm engineers, into a convenient method of evaluation using a light effect prediction model, which is well adapted to the needs of large-scale production and rapid testing of standardized products.
[0037] The method for predicting the optical effects of images in the present invention can provide online early warning for lighting effect failures. On the production line, after the target characteristic variables corresponding to the optical parameters of the equipment to be detected are input into the optimal lighting effect prediction model, if the prediction results show that there are problems with the lighting effect, an alarm can be issued in time to avoid the production of a large number of defective products. At the same time, the method can also provide lighting effect adjustment suggestions for production line operators. The operators do not need to have deep knowledge of optics and algorithms, and can optimize the lighting effect according to the suggestions given by the model, thereby ensuring the smooth progress of the production process.
[0038] The method of predicting the optical effect of images in the present invention reduces the reliance on technical support from optical and algorithm engineers. On-site debugging personnel can directly use the optical effect prediction model to determine the on-site debugging effect of visual equipment without waiting for on-site evaluation by engineers. This greatly reduces the technical evaluation links and links, reduces project costs, improves the labor efficiency of the production site, and enables human resources to be more reasonably allocated to other key production links. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the implementation methods of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the implementation methods or the description of the prior art. Obviously, the drawings in the following description are only exemplary, and for ordinary technicians in this field, other implementation drawings can be derived from the provided drawings without creative work.
[0040] The structures, proportions, sizes, etc. illustrated in this specification are only used to match the contents disclosed in the specification so as to facilitate understanding and reading by persons familiar with the technology. They are not used to limit the conditions under which the present invention can be implemented, and therefore have no substantial technical significance. Any structural modification, change in proportion or adjustment of size shall still fall within the scope of the technical contents disclosed in the present invention without affecting the effects and purposes that can be achieved by the present invention.
[0041] Figure 1 A flowchart of a method for predicting optical effects of an image according to the present invention;
[0042] Figure 2 The architecture diagram of the system for predicting the optical effect of an image of the present invention;
[0043] Figure 3 is a structural diagram of the light effect prediction model of the present invention;
[0044] Figure 4 A schematic diagram of the physical structure of an electronic device provided by the present invention;
[0045] Figure 5 Schematic diagram of the SVR support vector regression method of the present invention;
[0046] Figure 6 This is the architecture diagram of the Transformer modification of the present invention.
[0047] The accompanying drawings are denoted as follows:
[0048] Preprocessing module 10 , construction module 20 , prediction module 30 , early warning module 40 , electronic device 50 , processor 501 , memory 502 , bus 503 . DETAILED DESCRIPTION
[0049] The following is a description of the implementation of the present invention by specific embodiments. People familiar with the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] Figure 1 Flow chart of an embodiment of the method for predicting the optical effect of an image according to the present invention, as shown in FIG. Figure 1 As shown, a method for predicting an image optical effect provided by an embodiment of the present invention comprises the following steps:
[0051] S101, obtaining optical parameters of a visual inspection device, performing a pre-screening process on the optical parameters, and obtaining final characteristic variables;
[0052] Specifically: extracting a number of original characteristic variables based on the optical parameters;
[0053] Calculating correlation coefficients of a plurality of the original feature variables corresponding to the prediction of the image optical effect;
[0054] The original feature variables whose correlation coefficients exceed the preset standard range are extracted as the final feature variables.
[0055] Finally, the final characteristic variables include the brightness of each light source, the angle between the light source and the camera relative to the workpiece, the distance between the light source and the camera relative to the workpiece, the lens aperture, the lens focal length, the camera pixel accuracy, the light source wavelength and color spectrum, and the camera frame rate.
[0056] The defect types are common defects in the industrial field, generally including but not limited to welding slag, welding holes, cold welding, leaking welding, broken welding, welding height misalignment, surface scratches, surface scratches, local bumps, plastic or film damage, pits, pits, wrong or missing installation, plastic wire, aluminum wire, bubbles, foreign matter in the film, damaged and exposed white film, electrolyte contamination, various types of dirt, imprints, blank spaces, etc.
[0057] S102, constructing an initial light effect prediction model, taking the final feature variable as the input of the initial light effect prediction model, and performing mapping training between the final feature variable and the image quality score to obtain an optimal light effect prediction model;
[0058] The first embodiment is to construct an initial light effect prediction model based on a multi-layer perceptron neural network based on the BP back propagation algorithm. Figure 3 As shown, the initial light effect prediction model includes an input layer, a hidden layer and an output layer;
[0059] The characteristic dimension of the input layer is consistent with the number of parameter types, both of which are n. The number of hidden layers is two or more. When the number of hidden layers is two, the number of hidden layers is recorded as A layer and B layer respectively, the number of neurons in A layer is m, the number of neurons in B layer is h, and m and h are non-specific variables;
[0060] The final feature variable is received through the input layer, feature extraction, conversion, nonlinear mapping and information integration are performed on the final feature variable through the hidden layer, and the image quality score is output through the output layer.
[0061] The input layer plays a key role in receiving data, and its feature dimension is consistent with the number of parameter types. This means that for each different type of parameter involved in light effect prediction, such as light source brightness, the angle between the light source and the camera relative to the workpiece, the distance between the light source and the camera relative to the workpiece, lens aperture, lens focal length, camera pixel accuracy, light source wavelength and color spectrum, and camera frame rate, there are corresponding independent input channels or neurons in the input layer. This design ensures that all key information related to light effects is fully and accurately imported into the model, providing a comprehensive data foundation for subsequent model training and prediction.
[0062] The hidden layer is the core area of the model for complex data processing and feature extraction. The number of hidden layers m and the number of neurons n are set as non-specific variables, which provides great flexibility for model optimization and adjustment. In the actual model training process, the combination of different number of layers m and number of neurons n is repeatedly tested and explored to seek a better solution under the condition of ensuring the iterative convergence of model training. In the training iteration process, as the data is transmitted and processed layer by layer in the hidden layer, the connection weights between neurons will be continuously adjusted and optimized according to the BP back propagation algorithm. For example, when the number of hidden layers is increased, the model can perform deeper and more detailed feature abstraction and transformation of the data, but it may also face the risk of overfitting; and the reasonable adjustment of the number of neurons can find a balance between the expressive power and computational complexity of the model. Through a large number of experiments and data analysis, the combination of m and n values that makes the model have a high accuracy rate on the training set and maintains good generalization performance on the validation set and test set is determined, so as to construct a light effect prediction model with high prediction accuracy and reliability.
[0063] The output layer outputs the image quality score. The image quality score includes multi-dimensional prediction results, which can provide a comprehensive and detailed basis for evaluating the optical effect of the image. It has extremely important application value in the research and development of optical equipment, quality inspection in the production process, and image post-processing and optimization.
[0064] The second embodiment is: Figure 5 As shown in the figure, an initial light effect prediction model is constructed based on the support vector regression method. During the mapping training process, different optical parameters are used as the input of the initial light effect prediction model and mapped to a high-dimensional space to regress the quality score. For example, the commonly used Gaussian radial basis kernel function (RBF) can skillfully transform the optical parameters that are complex and may present nonlinear relationships in low-dimensional space into high-dimensional space, so that in high-dimensional space, the relationship between optical parameters and image quality scores is closer to a linear or easy-to-fit form. This mapping method greatly enhances the model's ability to process complex light effect data and can dig out deep-level correlation patterns hidden behind the data.
[0065] The initial light effect prediction model is optimized using an optimization strategy of maximizing the width of the interval band and minimizing the total loss to obtain the optimal light effect prediction model, where ε represents 1 / 2 of the maximum interval band width. Maximizing the interval band width is of great significance, as it can significantly improve the generalization performance of the model, so that the model can still give relatively accurate and reliable prediction results when faced with new optical parameter combinations that have not appeared in the training set. The setting of the interval band is similar to the maximum interval division of different categories of data in the classification support vector machine, except that in the regression problem, it specifies the area within a certain error tolerance range, and the model will try to encourage as many data points as possible to fall into this interval band.
[0066] At the same time, minimizing the total loss focuses on the errors caused by data points outside the interval band. By reasonably weighing these two optimization goals, a balance is usually achieved by adjusting the penalty parameter C to build a robust model that can accurately capture the overall trend of the data and has a certain fault tolerance for individual abnormal data points. During the training process, the model will continuously calculate and adjust its own parameters based on the input optical parameters and the corresponding image quality score data, so as to gradually achieve the dual goals of maximizing the width of the interval band and minimizing the total loss. After multiple rounds of iterative training and optimization, an optimal light effect prediction model with high accuracy and stable performance is finally obtained. The model can accurately predict the corresponding image optical effect quality score based on the input optical parameters, providing strong support and guarantee for the evaluation and optimization of optical systems and related image processing applications.
[0067] The third embodiment is: Figure 6 As shown, an optimal light effect prediction model is constructed based on the improved Transformer network;
[0068] The improved Transformer network can be implemented by eliminating the position encoder and the embedded data alignment link, retaining the Encoder module or the Decoder module and the attention mechanism and feedforward neural network principle therein, taking the final feature variable as the input of the initial light effect prediction model, and converting the final feature variable into a probability form through linear decomposition to obtain an image quality score.
[0069] In the field of light effect prediction, the effectiveness of the Transformer network improvement method is mainly measured by whether it can accurately predict the impact of light effects on image quality. Therefore, no matter what specific improvement method is adopted, as long as this functional goal can be achieved, it is functionally equivalent to this solution. The present invention focuses on achieving the function of accurate light effect prediction, and is not limited to the specific modification method described.
[0070] Position encoders and embedded data alignment links are mainly used to process sequence data and capture the semantic and position information therein. However, in the context of image optical effect prediction, the data characteristics are fundamentally different from natural language sequences. Therefore, the position encoder, a component originally used to add position information to sequence elements, is cancelled. In natural language processing, embedding is to map discrete symbols such as words into low-dimensional continuous vectors and align data to construct a processable sequence representation, but for optical parameterized feature vectors, they are already quantized and organized numerical vectors, and do not need to go through the embedding process to convert symbolic information, nor do they have alignment requirements like text sequences.
[0071] In terms of network architecture preservation, the Encoder module or Decoder module and the attention mechanism and feedforward neural network principle therein are retained. The attention mechanism in the Encoder module, especially the multi-head attention mechanism, can perform multi-dimensional and comprehensive correlation analysis on the input optical parameterized feature vector. The feedforward neural network performs nonlinear transformation and deep feature extraction on the processed features after the attention mechanism. It can further integrate and abstract the correlation features focused on by the attention mechanism.
[0072] Finally, before the output layer of the model, the linear layer and softmax functions are used to decompose the linear transformation into probability and then calculate the output to obtain the image quality score. The linear layer first linearly combines and adjusts the dimensions of the features output by the previous module (whether it is the result of a series of processing by the encoder or decoder). It can perform weighted summation and remap features of different dimensions according to the pre-set weight matrix, so that the dimension of the feature vector matches the requirements of the subsequent softmax function, and also performs a preliminary integration and normalization of the features. On this basis, the softmax function plays a key role in probability conversion, converting the output of the linear layer into the probability distribution of different defect image quality score intervals. For example, the possible score interval of image clarity [0,10] is calculated by the softmax function to obtain the probability value of image clarity belonging to each subdivided interval (such as [0,2], [2,4], etc.). This probability output form is very intuitive and practical. In practical applications, whether it is used for quality assessment and screening of optical equipment or to provide decision-making basis for image post-processing, these probability values can be used to more comprehensively and scientifically judge the quality of image optical effects and the types and severity of possible problems, thereby providing professionals in related fields with accurate, reliable and instructive information and data support, and promoting the in-depth development and wide application of image optical effect prediction and optimization technology in photography, optical instrument manufacturing, computer vision and other fields.
[0073] Dividing the final feature variables into a training set, a validation set, and a test set;
[0074] Training the initial light effect prediction model based on the training set;
[0075] Performing a performance evaluation on the trained initial light effect prediction model based on the validation set to obtain an initial light effect prediction model that meets performance conditions;
[0076] The prediction result of the initial light effect prediction model that meets the performance condition is evaluated based on the test set to obtain an evaluation index corresponding to the initial light effect prediction model.
[0077] Based on the validation set, the performance of the trained initial light effect prediction model is evaluated to obtain an initial light effect prediction model that meets the performance conditions; based on the test set, the similarity calculation result of the initial light effect prediction model that meets the performance conditions is evaluated to obtain an evaluation index corresponding to the initial light effect prediction model. The performance of the initial light effect prediction model is evaluated to obtain a percentage-based image quality score (i.e., the highest score is 100 points and the lowest score is 0 points), and the initial light effect prediction model with a score greater than a set value is determined based on the percentage-based score. For example, an initial light effect prediction model with a score greater than 90 points is an initial light effect prediction model that meets the performance conditions; the performance evaluation of the initial light effect prediction model in this application is not limited to a percentage-based image quality score, but can also be other quality scores, quality coefficients, GRR%, and other quality evaluation indicators.
[0078] An evaluation index is calculated for an initial light efficiency prediction model that meets performance conditions to obtain the evaluation index of the initial light efficiency prediction model, and an evaluation value corresponding to each evaluation index is calculated to represent the capability value of the initial light efficiency prediction model on the evaluation index.
[0079] S103, inputting the target characteristic variables corresponding to the optical parameters of the device to be detected into the optimal light effect prediction model, obtaining the image quality score corresponding to the optical parameters of the device to be detected, and measuring the image optical effect of the device to be detected based on the image quality score;
[0080] Specifically, whether the image quality meets the standard is judged based on the image optical effect prediction, and when the image quality does not meet the standard, a warning message is generated.
[0081] When the image quality does not meet the standard, the type of image quality that does not meet the standard is determined based on the image optical effect prediction, and a corresponding processing plan is determined based on the type of image quality that does not meet the standard. The processing plan is sent to the corresponding processing personnel user end, and the processing personnel take processing measures based on the processing plan.
[0082] This method for predicting the optical effects of images inputs variable parameters such as light source and camera as feature vectors, and allows the initial light effect prediction model to map the input optical parameter feature vectors with image quality, thereby obtaining an algorithm capable of continuously predicting image quality. This ensures that the parameters of the production line visual equipment or visual system are correct each time the picture is taken, and that the quality of the image can be estimated and warned, so as to facilitate debugging personnel to debug to the ideal effect, intelligent warning production of the production line, and further improve the compatibility range of optical imaging for detection capabilities and the scientificity of visual system maintenance scheduling.
[0083] Figure 2 Flow chart of a system embodiment for predicting the optical effect of an image according to the present invention; Figure 2 As shown, a system for predicting an image optical effect provided by an embodiment of the present invention includes the following steps:
[0084] A preprocessing module 10 is used to obtain optical parameters of the visual inspection device, perform pre-screening processing on the optical parameters, and obtain final characteristic variables;
[0085] The pre-processing module 10 is also used for:
[0086] Extracting a plurality of original characteristic variables based on the optical parameters;
[0087] Calculating correlation coefficients of a plurality of the original feature variables corresponding to the prediction of the image optical effect;
[0088] The original feature variables whose correlation coefficients exceed the preset standard range are extracted as the final feature variables.
[0089] The final characteristic variables include the brightness of each light source, the angle between the light source and the camera relative to the workpiece, the distance between the light source and the camera relative to the workpiece, the lens aperture, the lens focal length, the camera pixel accuracy, the light source wavelength and color spectrum and the camera frame rate.
[0090] A construction module 20 is used to construct an initial light effect prediction model, use the final feature variable as the input of the initial light effect prediction model, and perform mapping training between the final feature variable and the image quality score to obtain an optimal light effect prediction model;
[0091] The prediction module 30 is used to input the target characteristic variables corresponding to the optical parameters of the device to be detected into the optimal light effect prediction model, obtain the image quality score corresponding to the optical parameters of the device to be detected, and measure the image optical effect of the device to be detected based on the image quality score.
[0092] The early warning module 40 is used to judge whether the image quality meets the standard based on the image optical effect prediction, and generate early warning information when the image quality does not meet the standard.
[0093] When the image quality does not meet the standard, the type of image quality that does not meet the standard is determined based on the image optical effect prediction, and a corresponding processing plan is determined based on the type of image quality that does not meet the standard. The processing plan is sent to the corresponding processing personnel user end, and the processing personnel take processing measures based on the processing plan.
[0094] Figure 4 A schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention, such as Figure 4 As shown, the electronic device 50 includes: a processor 501 (processor), a memory 502 (memory) and a bus 503; wherein the processor 501 and the memory 502 communicate with each other through the bus 503;
[0095] The processor 501 is used to call the program instructions in the memory 502 to execute the above
[0096] The method provided in the method embodiment is used to execute the method provided in the implementation mode of the present invention.
[0097] This embodiment provides a non-transitory computer-readable storage medium, which stores computer instructions. The computer instructions enable a computer to execute the method provided by the embodiment of the present invention.
[0098] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, etc., various storage media that can store program codes.
[0099] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.
[0100] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.
[0101] Although the present invention has been described in detail above by general description and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements can be made to the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all belong to the scope of protection claimed by the present invention.
Claims
1. A method for predicting the optical effect of an image, characterized in that: The method for predicting the optical effect of an image specifically comprises: Acquiring optical parameters of a visual inspection device, performing a pre-screening process on the optical parameters, and obtaining final characteristic variables; Constructing an initial light effect prediction model, taking the final feature variable as input of the initial light effect prediction model, and performing mapping training on the final feature variable and the image quality score to obtain an optimal light effect prediction model; The target characteristic variables corresponding to the optical parameters of the device to be detected are input into the optimal light effect prediction model to obtain the image quality score corresponding to the optical parameters of the device to be detected, and the image optical effect of the device to be detected is measured based on the image quality score.
2. The method for predicting the optical effect of an image according to claim 1, characterized in that: The step of obtaining optical parameters of the visual inspection device and performing a pre-screening process on the optical parameters to obtain final characteristic variables includes: Extracting a plurality of original characteristic variables based on the optical parameters; Calculating correlation coefficients of a plurality of the original feature variables corresponding to the prediction of the image optical effect; The original feature variables whose correlation coefficients exceed the preset standard range are extracted as the final feature variables.
3. The method for predicting the optical effect of an image according to claim 1, characterized in that: The final characteristic variables include the brightness of each light source, the angle between the light source and the camera relative to the workpiece, the distance between the light source and the camera relative to the workpiece, the lens aperture, the lens focal length, the camera pixel accuracy, the light source wavelength and color spectrum and the camera frame rate.
4. The method for predicting the optical effect of an image according to claim 1, characterized in that: The constructing of the initial light effect prediction model further includes: Construct an initial light effect prediction model based on a multi-layer perceptron neural network; The initial light effect prediction model includes an input layer, a hidden layer and an output layer. The feature dimension of the input layer is consistent with the number of parameter types. The number of hidden layers is two or more. When the number of hidden layers is two, the number of hidden layers is recorded as A layer and B layer respectively. The number of neurons in the A layer is m, and the number of neurons in the B layer is h, where m and h are non-specific variables. The final feature variable is received through the input layer, feature extraction, conversion, nonlinear mapping and information integration are performed on the final feature variable through the hidden layer, and the image quality score is output through the output layer.
5. The method for predicting the optical effect of an image according to claim 1, characterized in that: The constructing of the initial light effect prediction model further includes: An initial light efficiency prediction model is constructed based on the support vector regression method. During the mapping training process, different optical parameters are used as inputs of the initial light efficiency prediction model and mapped to a high-dimensional space to regress the quality score. The initial light efficiency prediction model is optimized using an optimization strategy that maximizes the width of the interval band and minimizes the total loss to obtain the optimal light efficiency prediction model.
6. The method for predicting the optical effect of an image according to claim 1, characterized in that: The constructing of the initial light effect prediction model further includes: Construct the optimal lighting effect prediction model based on the improved Transformer network.
7. The method for predicting the optical effect of an image according to claim 6, characterized in that: The method for predicting the optical effect of an image further comprises: Determining whether the image quality meets the standard based on the image optical effect prediction, and generating warning information when the image quality does not meet the standard; When the image quality does not meet the standard, the type of image quality that does not meet the standard is determined based on the image optical effect prediction, and a corresponding processing plan is determined based on the type of image quality that does not meet the standard. The processing plan is sent to the corresponding processing personnel user end, and the processing personnel take processing measures based on the processing plan.
8. A system for predicting image optical effects, characterized in that: include: A preprocessing module, used to obtain optical parameters of the visual inspection equipment, perform pre-screening processing on the optical parameters, and obtain final characteristic variables; A construction module, used to construct an initial light effect prediction model, use the final feature variable as the input of the initial light effect prediction model, and perform mapping training between the final feature variable and the image quality score to obtain an optimal light effect prediction model; The prediction module is used to input the target characteristic variables corresponding to the optical parameters of the device to be detected into the optimal light effect prediction model, obtain the image quality score corresponding to the optical parameters of the device to be detected, and measure the image optical effect of the device to be detected based on the image quality score.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A non-transitory computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.