Optimization method for destructive sampling detection in product production process

By combining simulated annealing algorithm and Bayesian sequential probability ratio test to optimize the prior distribution, the problem of strong subjectivity of prior distribution selection in destructive sampling detection is solved, efficient and accurate product quality judgment is achieved, and sampling costs and losses are reduced.

CN120258592APending Publication Date: 2025-07-04SHAANXI UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510289434.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-12
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

In the destructive sampling detection, the prior art has the problem of strong subjectivity of prior distribution selection, resulting in unstable results, high sampling cost and low efficiency.

Method used

Combining the simulated annealing algorithm and Bayesian sequential probability ratio test, we optimize the prior distribution selection, and extensive exploration of the simulated annealing algorithm at high temperatures, gradually converge to the global optimal solution, and set the decision boundary in combination with the Neyman-Pearson principle to optimize the prior distribution and parameter estimation.

Benefits of technology

On the premise of ensuring the accuracy of inspection, reduce unnecessary sampling quantity, reduce destructive inspection losses, and improve production efficiency and quality control level.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure SMS_10
    Figure SMS_10
  • Figure SMS_11
    Figure SMS_11
  • Figure SMS_14
    Figure SMS_14
Patent Text Reader

Abstract

The invention discloses an optimization method for destructive sampling detection in a product production process. The method comprises the following steps: 1, performing initialization setting in a simulated annealing algorithm stage; 2, performing simulated annealing algorithm iteration based on the parameters initialized in the step 1, and optimizing the parameters through an iteration process; 3, setting hypothesis and decision boundaries in the Bayesian sequential probability ratio test; step 4, calculating a likelihood ratio by using the parameters optimized in the step 2 and based on prior distribution optimized by a simulated annealing algorithm; and 5, comparing the likelihood ratio calculated in the step 4 with a decision boundary value to make a decision. On the premise of ensuring the inspection accuracy, the sampling efficiency is improved, and the sampling cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of sampling inspection in the production process, and particularly relates to an optimization method for destructive sampling inspection in the product production process. Background Art

[0002] In daily production and life, in order to ensure product quality, it is necessary to supervise the product production process and at the same time inspect the products, that is, a quality control method of extracting some products from a large number of products according to certain rules for inspection in each link of product production. If the sample test result meets the quality standard, the production process can continue; when it is detected that the product does not meet the quality standard, corresponding measures need to be taken immediately. Usually, product inspection is the last link to control product quality. For product production enterprises, their benefits and reputation are affected and restricted by the quality of product inspection work.

[0003] Currently, many enterprises usually adopt methods such as comprehensive inspection, simple random sampling, and sequential probability ratio test when organizing and carrying out product quality inspection work. For the sampling inspection of products with the characteristics of "high cost, destructive" tests, such as the hit rate of missiles and the service life of aircraft black boxes, how to improve the efficiency of product sampling inspection and reduce the test cost of product sampling inspection is the core issue in the sampling inspection plan. The sequential probability ratio test adopts an experimental strategy of "try and see, see and try". Compared with other methods, it has certain advantages: this inspection method does not require a fixed sample size, but by comparing the value obtained after inspection with a given threshold until the sample provides enough information to make an appropriate decision. The average sample size required by this method will be less than that of the fixed sample size test, greatly reducing the test cost of product sampling inspection and having higher inspection efficiency.

[0004] However, the prerequisite for the sequential probability ratio test is that the prior distribution of the sample is known. Therefore, the Bayesian method and the sequential probability ratio test are combined to determine the prior probability using the Bayesian method. But this method has certain deficiencies: the Bayesian method depends on the choice of the prior distribution, and the prior information is subjective and sensitive. The prior probability distributions set by different people may be different, and the inaccuracy of the prior information will lead to unstable results. Summary of the Invention

[0005] In order to overcome the above problems existing in the prior art, the purpose of the present invention is to provide an optimization method for destructive sampling inspection in the product production process, which can improve the sampling efficiency and reduce the sampling cost on the premise of ensuring the inspection accuracy.

[0006] In order to achieve the above purpose, the technical solution adopted by the present invention is:

[0007] An optimization method for destructive sampling inspection in the product production process, comprising the following steps;

[0008] Step 1: Perform initialization settings in the simulated annealing algorithm stage;

[0009] Step 2: Based on the parameters set in the initialization in Step 1, perform iterations of the simulated annealing algorithm, and optimize the parameters through the iteration process;

[0010] Step 3: Set hypotheses and decision boundaries in the Bayesian sequential probability ratio test;

[0011] Step 4: Using the parameters optimized in Step 2, calculate the likelihood ratio based on the prior distribution optimized by the simulated annealing algorithm;

[0012] Step 5: Compare the likelihood ratio calculated in Step 4 with the decision boundary value to make a decision.

[0013] In the said Step 1, the initialization settings include: according to the objective of the Bayesian sequential probability ratio test, determine a suitable objective function. For destructive product quality inspection, the objective function can be to minimize the probability of misjudging whether the product is qualified or not; represent the possible prior distribution types in a parameterized way, use a mixture model, where the prior distribution type is selected by an indicator variable, and each distribution type has its corresponding parameters, such as k = 1 represents the normal distribution, k = 2 represents the Beta distribution; randomly initialize the prior distribution type indicator variable k, and initialize its corresponding parameters within the determined parameter range, and use this as the starting point.

[0014] The specific steps of the said Step 2 are as follows:

[0015] Step 1: Set the initial temperature T0, the temperature reduction rate and the termination temperature T1;

[0016] Step 2: In each iteration, make a small change to the current prior distribution type indicator variable k and its corresponding parameters. For the indicator variable k, change it from one distribution type to another with a certain probability, and add a small random perturbation to the parameters to change them; then calculate the difference ΔJ between the value of the objective function under the new prior distribution and the initial value;

[0017] Step 3: According to the Metropolis criterion, decide whether to accept the new solution. If ΔJ ≤ 0, accept the new solution; if ΔJ > 0, then with probability p = e -ΔJ / T accept the new solution, where T is the current temperature and R is a random number between (0, 1). If p > R, still accept the new solution, otherwise, still use the initial solution as the solution;

[0018] Step 4: According to the temperature reduction rate Update temperature

[0019] Step 5: After the temperature decays, return to Step 2 until T ≤ T1 is satisfied, and the annealing simulation process ends. At this time, the prior distribution type indicator variable k and the corresponding parameter combination obtained can determine a relatively optimal prior distribution.

[0020] In Step 3, observing x gives a sequence of n independent and identically distributed random variables x1, x2, x3…x n , and two hypotheses are proposed for the total sample: The null hypothesis H0: θ = θ0 and the alternative hypothesis H1: θ = θ1 constitute a binary sequential probability ratio test;

[0021] Since it cannot be guaranteed to be correct when conducting a hypothesis test, the following two types of errors will inevitably occur when making a judgment: Type I error: When the null hypothesis H0 is correct, a judgment is made to reject the null hypothesis, resulting in the acceptance of the alternative hypothesis in the end. Such an error is the Type I error, also known as the "false rejection" error. The probability of making a Type I error is called the false rejection probability, generally denoted by . Another type of error: When the null hypothesis H0 is wrong, a judgment is made to accept the null hypothesis, leading to the rejection of the alternative hypothesis in the end. Such an error is the Type II error, also known as the "false acceptance" error. The probability of making a Type II error is called the false acceptance probability, generally denoted by β.

[0022] Regarding the probabilities of making the two types of errors, Neyman - Pearson proposed a principle: Under the premise of controlling , try to minimize β as much as possible. This also indicates that the null hypothesis cannot be rejected without sufficient reason. is called the significance level of the test, and the commonly taken values are 0.1, 0.05, 0.01, etc. According to the probability of making a Type I error and the probability β of making a Type II error in hypothesis testing, the corresponding thresholds A and B are determined, where

[0023] In Step 4, define the joint probability density of the two as follows:

[0024]

[0025] where f j (x) represents the joint probability density function of the sample x under the assumption H j , here j takes 0 or 1, corresponding to different hypothesis cases; P(x1,…x n |H j ) represents the probability of the sample x1, x2…, x under the assumption H j conditions.n Conditional probability of simultaneous occurrence; f(x i / θ j ) represents the probability density function of the i-th sample x j under the parameter θ i ; x i represents the i-th observed value in the sample, i = 1, 2, …, n, where n is the number of samples; θ j is a parameter related to the hypothesis H j .

[0026] The likelihood ratio λ n of the sequential probability ratio test is calculated as follows:

[0027]

[0028] where λ n (x), λ n (x1, … x n ) both represent the likelihood ratio of the n-th step sequential probability ratio test calculated based on the sample x; P(x1, … x n |H1) represents the joint probability of the occurrence of the samples x1, x2, …, x n under the condition that the hypothesis H1 holds; P(x1, … x n |H0) represents the joint probability of the occurrence of the samples x1, x2, …, x n under the condition that the hypothesis H0 holds; f(x i |θ1) represents the probability density function of the i-th sample x i under the parameter θ1 (corresponding to the hypothesis H1); f(x i |θ0) represents the probability density function of the i-th sample x i under the parameter θ0 (corresponding to the hypothesis H0); x i represents the i-th observed value in the sample, i = 1, 2, …, n, where n is the number of samples.

[0029] In step 5, assuming x1 is the first value, the likelihood ratio λ1(x1) is obtained from the likelihood ratio calculation formula and compared with the thresholds A and B calculated by controlling the probabilities of type I error and type II error according to the Neyman - Pearson principle;

[0030] If the likelihood ratio satisfies: λ1(x1) < B, the test is stopped at this time, the null hypothesis H0 is accepted, and the alternative hypothesis H1 is rejected; if the likelihood ratio satisfies: λ1(x1) > A, the detection is also stopped, the alternative hypothesis H1 is accepted, and the null hypothesis H0 is rejected; if the likelihood ratio λ1(x1) satisfies: B ≤ λ1(x1) ≤ A, then the next set of values is extracted and the test continues until the requirements for stopping the test are met, and finally a judgment is given.

[0031] Advantages of the present invention:

[0032] The simulated annealing algorithm is a global optimization method. It simulates the physical annealing process, conducts extensive exploration at high temperatures, and gradually converges to the global optimal solution as the temperature gradually decreases. In the Bayesian statistical framework, combining the simulated annealing algorithm with the Bayesian sequential probability ratio test is highly effective in optimizing the prior distribution selection and parameter estimation. The prior distribution plays a crucial role throughout the process, and its quality directly affects whether the subsequent inferences can be carried out reliably. The simulated annealing algorithm has the ability to deeply explore the prior distribution parameter space. It simulates the performance of the Bayesian sequential probability ratio test under different prior distributions and parameter settings, thereby accurately finding the type of prior distribution and parameters that can make the test results closest to the real situation.

[0033] Compared with the traditional methods based on subjective experience and simple presets, this combination method overcomes the subjectivity of prior distribution selection and provides accurate prior information for sequential probability ratio sampling detection. This can not only reduce unnecessary sampling quantities, reduce product losses caused by destructive testing, but also make the test results closer to the real quality situation, ensure the reliability of quality inferences during the production process, and improve production efficiency and product quality control levels. Specific implementation manner

[0034] The present invention will be further described in detail below.

[0035] Example background: A factory produces an electronic component, and its service life is an important quality indicator. First, destructive sampling detection needs to be carried out on this electronic component to determine whether the average service life of this batch of products meets the specified standard. According to historical experience, the specified standard is an average service life of θ0 = 1000 hours.

[0036] Specific steps:

[0037] Step 1: Conduct initialization settings in the simulated annealing algorithm stage. According to the objective of the Bayesian sequential probability ratio test, determine a suitable objective function; represent possible prior distribution types in a parameterized manner, use a mixture model, where the prior distribution type is selected by an indicator variable, and each distribution type has its corresponding parameters. For example, k = 1 represents the normal distribution, and k = 2 represents the Beta distribution; randomly initialize the prior distribution type indicator variable k and initialize its corresponding parameters within the determined parameter range as the starting point.

[0038] For this destructive product quality inspection, the objective function is to minimize the probability of misjudging whether the product is qualified, that is, to hope to accurately judge whether the average service life of this batch of electronic components meets the standard and reduce misjudgment. Considering that the life distributions of products such as electronic components are often described by the normal distribution and the exponential distribution, it is assumed that k = 1 represents the normal distribution and k = 2 represents the exponential distribution.

[0039] For the convenience of calculation, take the logarithm of it. Combining the above content, we establish the objective function as:

[0040]

[0041] The entire objective function determines whether to follow the normal distribution or the exponential distribution to calculate the objective function value based on the value of k. Among them, μ1 is the mean of the normal distribution, σ1 is the standard deviation of the normal distribution, λ2 is the parameter of the exponential distribution, and x i represents the observed service life value of the i-th sampled electronic component, and n is the sampling quantity. The better the sampling data x i fits the assumed normal distribution or exponential distribution, the smaller the value of the objective function. Then we initialize the parameters, assuming k = 1, u1 = 900, σ1 = 100, λ2 = 0.001.

[0042] Step 2: Perform iterations of the simulated annealing algorithm.

[0043] The specific steps are as follows:

[0044] Step1: Set the initial temperature T0 = 100, the temperature reduction rate and the termination temperature T1 = 1;

[0045] Step2: In each iteration, change k with a probability of 0.1. For the parameters, if k = 1 (normal distribution), add a normal random perturbation with a mean of 0 and a standard deviation of 10 to μ, and add a normal random perturbation with a mean of 0 and a standard deviation of 5 to σ; if k = 2, add a normal random perturbation with a mean of 0 and a standard deviation of 0.0001 to λ. Calculate the difference ΔJ between the objective function value under the new prior distribution and the initial value.

[0046] Step 3: Decide whether to accept the new solution according to the Metropolis criterion. If ΔJ ≤ 0, accept the new solution; if ΔJ > 0, then with probability p = e -ΔJ / T accept the new solution, where T is the current temperature. R is a random number between (0, 1). If p > R, still accept the new solution; otherwise, retain the initial solution.

[0047] Step 4: Update the temperature according to the temperature reduction rate

[0048] Step 5: After the temperature decays, return to Step 2 until T ≤ T1 is satisfied, and the annealing simulation process ends. At this time, the prior distribution type indicator variable k and the corresponding parameter combination obtained can determine a relatively optimal prior distribution.

[0049] In the iterative process of the simulated annealing algorithm, continuously adjust k and the parameters of the corresponding distribution to minimize the objective function. This process is actually exploring which distribution and the specific parameter settings of this distribution can best fit the sampling data. Implement the above simulated annealing algorithm through Python or Matlab to obtain the prior distribution type and parameters that best match the actual data, thereby providing the most reliable prior information basis for subsequent product quality judgment.

[0050] Step 3: Set hypotheses and decision boundaries in the Bayesian sequential probability ratio test. By setting the null hypothesis and the alternative hypothesis, clarify the different conditions for product qualification and non - qualification, providing a clear direction for quality judgment based on sampling data. According to the Neyman - Pearson principle, control the probability of type I error and the probability of type II error β, calculate the corresponding thresholds A and B to determine the decision boundary, establish standards and criteria for subsequent product quality judgment based on sampling data, effectively control the risk of making wrong decisions in the process of judging product quality, make the final judgment result more reliable to a certain extent, reduce the possibility of misjudgment, and ensure the accuracy of product quality assessment.

[0051] Observing x gives a sequence of n independent and identically - distributed random variables x1, x2, x3...x n , and put forward two hypotheses for the total sample:

[0052] Null hypothesis H0: θ = θ0 = 1000 hours (product is qualified);

[0053] Alternative hypothesis H1: θ = θ1 = 800 hours (product is unqualified);

[0054] According to the Neyman - Pearson principle, control the probability of type I error ​The probability of type II error β = 0.1. According to and β, the threshold value is calculated as:

[0055]

[0056] Step 4: Calculate the likelihood ratio based on the prior distribution optimized by the simulated annealing algorithm. On the basis of the prior distribution optimized by the simulated annealing algorithm, according to the definition of the joint probability density and the calculation formula of the likelihood ratio of the sequential probability ratio test, combined with the distribution that the service life of the electronic components follows, calculate the likelihood ratio, which provides a quantitative basis for finally judging whether the average service life of this batch of electronic components reaches the specified standard. By comparing the likelihood ratio with the decision boundary, the judgment result can be obtained. Calculating the likelihood ratio by combining the prior distribution and different distribution models fully considers the statistical characteristics and uncertainties of the data, making the final product quality judgment process based on the comparison of the likelihood ratio and the decision boundary more reliable, and helping to accurately determine whether this batch of electronic components meets the specified quality standards.

[0057] Define the joint probability density of the two as follows:

[0058]

[0059] The likelihood ratio λ of the sequential probability ratio test n The calculation formula is:

[0060]

[0061] When the service life of the electronic components follows a normal distribution, then σ is the known standard deviation of the sampled data; when the service life of the electronic components follows an exponential distribution, then f(x|λ) = λe -λx .

[0062] Step 5: Compare the likelihood ratio with the decision boundary value to make a decision. Assume that x is the value of the sampled sample. The likelihood ratio λ(x) is obtained from the likelihood ratio calculation formula and compared with the set threshold values A = 18 and B = 0.1053. If the likelihood ratio satisfies: λ(x) < B, stop the test at this time, accept the null hypothesis H0, reject the alternative hypothesis H1, and consider that the average service life of this batch of electronic components reaches the specified standard and the product is qualified; if the likelihood ratio satisfies: λ(x) > A, also stop the test, accept the alternative hypothesis H1, reject the null hypothesis H0, that is, consider that the average service life of this batch of electronic components does not reach the specified standard and the product is unqualified; if the likelihood ratio λ1(x1) satisfies: B ≤ λ(x) ≤ A, then extract the next set of values and continue the test until the requirements for stopping the test are met, and finally give a judgment.

[0063] Based on the above steps, it is possible to judge whether this batch of electronic components is qualified.

Claims

1. An optimization method for destructive sampling inspection in the product production process, characterized in that, It includes the following steps; Step 1: Conduct initialization settings in the simulated annealing algorithm stage; Step 2: Based on the parameters set in the initialization in Step 1, perform iterations of the simulated annealing algorithm to optimize the parameters through the iterative process; Step 3: Set hypotheses and decision boundaries in the Bayesian sequential probability ratio test; Step 4: Using the parameters optimized in Step 2, calculate the likelihood ratio based on the prior distribution optimized by the simulated annealing algorithm; Step 5: Compare the likelihood ratio calculated in Step 4 with the decision boundary value to make a decision.

2. The optimized method for destructive sampling inspection during the production process of a product according to claim 1, wherein In the said Step 1, the initialization settings include: According to the objective of the Bayesian sequential probability ratio test, determine the objective function. For the destructive product quality inspection, the objective function is to minimize the probability of misjudging whether the product is qualified or not; Represent the possible prior distribution types in a parametric way, use a mixture model, where the prior distribution type is selected by an indicator variable, and each distribution type has its corresponding parameters; Randomly initialize the prior distribution type indicator variable k and initialize its corresponding parameters within the determined parameter range as the starting point.

3. The optimization method for destructive sampling inspection during the production process of a product according to claim 1, wherein, The specific steps of the said Step 2 are as follows: Step1: Set the initial temperature T0, the temperature decrease rate and the termination temperature T1; Step 2: In each iteration, make a small change to the current prior distribution type indicator variable k and its corresponding parameters. For the indicator variable k, change it from one distribution type to another with a certain probability, and add a small random perturbation to the parameters to change them; Then calculate the difference ΔJ between the value of the objective function under the new prior distribution and the initial value; Step 3: Decide whether to accept the new solution according to the Metropolis criterion. If ΔJ ≤ 0, accept the new solution; if ΔJ > 0, then with probability p = e -ΔJ / T accept the new solution, where T is the current temperature and R is a random number between (0, 1). If p > R, still accept the new solution; otherwise, still use the initial solution as the solution. Step4: According to the temperature drop rate Update the temperature Step 5: After the temperature decays, return to Step 2 until T≤T1 is satisfied and the annealing simulation process ends.

4. An optimization method for destructive sampling inspection in the production process of a product according to claim 1, characterized in that, In step 3, a set of n independent and identically distributed random variable sequences x1, x2, x3... x can be obtained by observing x. n For the total sample, two hypotheses are proposed: the null hypothesis H0: θ = θ0 and the alternative hypothesis H1: θ = θ1 constitute a binary sequential probability ratio test. When conducting a hypothesis test, the following two types of errors may occur when making a judgment: Type I error: When the null hypothesis H0 is correct, a judgment is made to reject the null hypothesis, resulting in the acceptance of the alternative hypothesis in the end. The probability of making a Type I error is called the probability of rejecting a true hypothesis, denoted by ; Another type of error: When the null hypothesis H0 is false, a judgment of accepting the null hypothesis is made, resulting in the rejection of the alternative hypothesis finally. The probability of making a Type II error is called the probability of false retention and is denoted by β; It should be under control On this premise, β should be minimized as much as possible. According to the probabilities of type I error and type II error β that occur in hypothesis testing, the corresponding thresholds A and B are determined, where 5. The optimized method for destructive sampling inspection in the production process of a product according to claim 1, characterized in that, In the said Step 4, define the joint probability density of the two as follows: where f j (x) represents the joint probability density function of the sample x under the hypothesis H j , where j takes 0 or 1, corresponding to different hypothesis cases; P(x1,…x n |H j ) represents the conditional probability of the simultaneous occurrence of the samples x1, x2…, x j under the hypothesis H n ; f(x i / θ j ) represents the probability density function of the i-th sample x j under the parameter θ i ; x i represents the i-th observed value in the sample, i = 1, 2,…, n, where n is the number of samples; θ j is the parameter related to the hypothesis H j .

6. The optimization method for destructive sampling inspection in the production process of a product according to claim 5, characterized in that, The likelihood ratio λ of the sequential probability ratio test n The calculation formula is as follows: where λ n (x), λ n (x1, …, x n ) both represent the likelihood ratio of the n - th sequential probability ratio test calculated based on the sample x; P(x1, …, x n |H1) represents the joint probability of the occurrence of the samples x1, x2, …, x n under the condition that the hypothesis H1 holds; P(x1, …, x n |H0) represents the joint probability of the occurrence of the samples x1, x2, …, x n under the condition that the hypothesis H0 holds; f(x i |θ1) represents the probability density function of the i - th sample x i under the parameter θ1 (corresponding to the hypothesis H1); f(x i |θ0) represents the probability density function of the i - th sample x i under the parameter θ0 (corresponding to the hypothesis H0); x i represents the i - th observed value in the sample, i = 1, 2, …, n, and n is the sample size.

7. An optimization method for destructive sampling inspection in the production process of a product according to claim 6, characterized in that, In step 5, set x1 as the first value, and calculate the likelihood ratio λ1(x1) using the likelihood ratio calculation formula Compare the obtained likelihood ratio λ1(x1) with the thresholds A and B calculated by controlling the probabilities of type I error and type II error according to the Neyman-Pearson principle; If the likelihood ratio satisfies: λ1(x1)<B, stop the test at this time, accept the null hypothesis H0, and reject the alternative hypothesis H1; If the likelihood ratio satisfies: λ1(x1)>A, also stop the test, accept the alternative hypothesis H1, and reject the null hypothesis H0; If the likelihood ratio λ1(x1) satisfies: B≤λ1(x1)≤A, then extract the next set of values and continue the test until the requirements for stopping the test are met, and finally give a judgment.