Preprint
Article

A Discrete Optimal Transport Based Melding Defect Detection Method for PCB in Gas Meter

Altmetrics

Downloads

46

Views

30

Comments

0

This version is not peer-reviewed

Submitted:

29 October 2024

Posted:

31 October 2024

You are already at the latest version

Alerts
Abstract
Ensuring the quality of printed circuit boards (PCBs) in gas meters is essential to the reliable operation and safety of these devices. Traditional methods for detecting welding defects on PCBs, such as machine vision and deep learning, present significant limitations. Machine vision-based approaches lack the precision required in complex environments, while deep learning methods demand large, labeled datasets that are costly and impractical in industrial contexts. This paper introduces a novel melding defect detection method based on discrete optimal transport (DOT) theory, focused on identifying discrepancies in welding areas between sample and reference images. By limiting analysis to the welding regions, the proposed approach reduces computational costs associated with high-resolution image processing while maintaining detection precision and independence from large datasets. The DOT model calculates the optimal mass flow between images, pinpointing specific defects and providing actionable insights for defect tracing and repair, thereby overcoming the limitations of existing methods. Experimental results demonstrate that this approach is both effective and efficient, offering a robust solution for quality assurance in PCB manufacturing for gas meters.
Keywords: 
Subject: Engineering  -   Industrial and Manufacturing Engineering

1. Introduction

Gas meters are indispensable measurement devices in modern urban infrastructure, widely used for quantifying gas consumption in residential and industrial environments [1,2]. With the rapid advancement of smart cities (where every single natural person in the city is managed by the government in order to provide intelligent service to all residents as a whole [3]), the role and significance of gas meters in energy management and intelligent monitoring have become increasingly prominent. The quality of gas meters directly affects the accuracy of gas measurement and the safety of users [4,5,6]. The control printed circuit board (PCB) of a gas meter, serving as its core component, is responsible for critical functions such as data processing, signal transmission, and control execution. The manufacturing quality of this PCB decisively influences the reliable operation of the gas meter. Therefore, ensuring the manufacturing quality of the gas meter’s control PCB is central and crucial to quality assurance in gas meter manufacturing [7,8].
The quality issues of gas meter control PCBs primarily arise from various defects during the manufacturing process, such as poor welding, component misplacement, and circuit breaks [9,10,11]. Among these, the detection precision of dynamic defects during manufacturing is the key factor determining the final product quality. Consequently, research focusing on enhancing the detection precision of dynamic defects in PCBs has become a hot spot in the field of defect detection.
Current research methodologies for PCB defect detection mainly include machine vision-based methods and deep learning algorithms [12,13,14]. Machine vision-based methods typically employ image processing techniques to identify surface defects on PCBs by comparing captured images with reference images. While these methods are straightforward and computationally efficient, they often lack the precision required to detect subtle defects, especially in complex or noisy backgrounds [15]. Moreover, they generally do not provide information that can guide the tracing of defects back to specific stages in the manufacturing process or inform effective repair strategies.
Deep learning approaches, such as those based on convolutional neural networks (CNNs), have been proposed to improve detection precision by learning complex patterns from large datasets [16,17]. These methods can achieve high accuracy in defect detection and classification. However, they require extensive training on large, labeled datasets, which can be time-consuming and costly to obtain. Additionally, deep learning models often act as black boxes, providing limited interpretability, which hinders their ability to guide defect tracing or repair in the manufacturing process.
In summary, existing research inadequately addresses the challenges of achieving high detection precision without the need for large training datasets and providing actionable insights for defect tracing and repair. Most methods focus solely on defect detection without offering the ability to analyze the discrepancies between the detected image and the desired image in a way that can inform corrective actions in the manufacturing process. This limitation hampers the ability to improve manufacturing processes based on the detection results.
To address these challenges, this paper proposes a melding defect detection method for PCBs in gas meters based on discrete optimal transport (as introduced in Section 2.3, the solution to a convex linear program introduced by Kantarovich [18]). The proposed method is an image comparison approach that contrasts the gathered images of the detecting areas with standard or desired images. Since solving discrete optimal transport problems can become computationally expensive, particularly when dealing with high-resolution images, our method mitigates this issue by focusing solely on the welding areas of the PCB. This localized analysis significantly reduces computational cost while maintaining precision. By utilizing discrete optimal transport theory, the method calculates the optimal mass flow between the detected image and the reference image, enabling precise identification of discrepancies in the welding areas. This high detection precision does not rely on large datasets for training, making it more practical for industrial applications where labeled data may be scarce. Furthermore, the calculated mass flow provides valuable information about the nature and extent of the defects, which can be used as a guide to trace back to potential issues in the manufacturing process and to inform subsequent repairs. This approach overcomes the limitations of existing methods by combining superior detection precision, minimal data requirements, relative low computational cost, and actionable insights for manufacturing process improvement and product repair, thereby offering a robust solution for quality assurance in gas meter manufacturing.
The specific structure of this paper is as follows: The literature review and related work are shown in Section 2. The problem definition and mathematical formulation are established in Section 3. The solver design to solve the optimal transport problem is presented in Section 4. The introduction for the welding defect detection method based on discrete optimal transport is described in Section 5. The experimental results and analysis are provided in Section 6. The conclusion to this paper is given in Section 7.

2. Literature Review and Related Work

2.1. Machine Vision-Based Methods

Machine vision has been widely used for PCB defect detection due to its ability to offer real-time monitoring and non-contact inspection at relatively low cost. Baygin et al. proposed a machine vision-based algorithm for detecting missing components and solder joint issues, demonstrating reliable detection in well-lit environments [14]. Similarly, Chang et al. applied machine vision techniques to detect soldering defects in PCBs, contributing to the faster and more cost-effective detection of welding problems [15].
Despite these benefits, machine vision approaches often struggle with precision, particularly when handling smaller or subtle defects. Liu and Qu found that in noisy environments, machine vision systems often fail to detect minor welding defects, leading to inaccuracies [19]. Ren et al. also noted that traditional machine vision systems face limitations in real-world conditions, such as variable lighting and background noise, which can compromise their detection accuracy [20]. Additionally, Baygin et al. highlighted that these systems provide little insight into the root causes of defects, making it difficult for manufacturers to trace issues back to their source [14].
Furthermore, Liao et al. emphasized that traditional machine vision methods often require manual tuning for different PCB designs, limiting their scalability in modern high-throughput production environments [21]. Despite their speed and cost advantages, these limitations make machine vision less suitable for environments requiring high precision in detecting subtle welding defects.

2.2. Deep Learning-Based Methods

Deep learning approaches, particularly convolutional neural networks (CNNs), have now become increasingly popular for PCB welding defect detection due to their ability to recognize complex patterns and achieve higher precision. Chen et al. demonstrated the effectiveness of deep learning-based models in detecting subtle defects in PCBs, achieving more than 95% accuracy [12]. Similarly, Legon et al. used CNN-based models to classify PCB defects, improving both detection accuracy and speed [22]. Liu et al. proposed a deep learning model that leveraged generative adversarial networks (GANs) to improve the resolution of PCB defect images, further enhancing detection performance [23].
However, deep learning models come with significant drawbacks. Ling et al. pointed out that these models are highly data-dependent, requiring large labeled datasets to perform effectively, which is a challenge in industrial environments where labeled defect data is scarce [24]. Pham et al. also emphasized the difficulties of acquiring enough training data, noting that deep learning models struggle when the dataset is small or unbalanced [25].
Moreover, the black-box nature of deep learning algorithms poses interpretability issues, as described by Sezer and Altan. This makes it difficult for manufacturers to understand the root causes of detected defects and to implement targeted repairs [10]. Although deep learning models significantly improve detection precision, their dependence on large datasets and lack of transparency make them challenging to deploy in many real-world manufacturing environments.

2.3. Optimal Transport

2.3.1. Monge’s Problem

The concept of optimal transport can be traced back to the period right before the French revolution. At that time, Monge proposed an intuitive idea of the optimal transport problem in a very practical reason: how to move a terrain from a given current landscape into another desired landscape with the least amount of total work done [26].
The initial formulation of the problem is as follows:
inf T : X X X c ( x , T ( x ) ) f ( x ) d x s . t . T 1 ( B ) f ( x ) d x = B g ( x ) d x B X
where X R 2 and f , g represents the current and desired landscape (as shown in Figure 1). Since the terrain does not change in size, f , g must satisfy X f ( x ) d x = X g ( x ) d x . c ( a , b ) represent the work of transporting a to b is convex.
However, since the function f , g are zero everywhere except in the landscape, the integral over X will lead to zero, thus the mass conservation constraint cannot be properly expressed. To solve this problem, replacing with measure instead is helpful. By using sum of weighted dirac masses to represent terrain, the problem can be solved. Then the Monge’s problem with measure is formulated as follows:
inf T : X Y X c ( x , T ( x ) ) d f s . t . g ( B ) = f ( T 1 ( B ) ) B X
where X , Y are measurable, and f , g are two measures on X , Y respectively, and the cost function c is convex. Note that the constraint g ( B ) = f ( T 1 ( B ) ) B X is the same as saying g is the push forward of f by T, g = T # f

2.3.2. Kantorovitch’s Relaxed Problem

Nevertheless, the Monge’s problem with measure has a problem that the mass cannot be splited or merged as shown in Figure 2. To solve it, Kantarovich introduced the idea of marginal and relaxed the problem into the following form [27]:
inf γ X × Y c ( x , y ) d γ ( x , y ) | γ Π ( f , g )
where
Π ( f , g ) = { γ P ( X × Y ) | π X # γ = f , π Y # γ = g }
Here γ Π , a measure on the product of space X , Y with marginal f , g , represents a transport plan between two measures f , g on X , Y . And π X : X × Y X is the projection map, so as π Y : X × Y Y . Note that the space of transport plans Π ( f , g ) is convex.
In this case, in contrast with Figure 2, the Kantorovitch’s relaxed problem allows mass to be splitted, and we can have optimal transport transport as shown in Figure 3.

2.3.3. Discrete Optimal Transport in 1D with Finite Element

The discrete optimal transport problem in 1D with finite element can be easily driven from the Kantarovich’s relaxed problem as follows:
min Φ { F l a t ( C ) · F l a t ( Φ ) } s . t . M X Φ = F M Y Φ = G ϕ i , j 0 i , j
where (i) F = ( f i ) i = 1 , . . . , m R m , G = ( g j ) j = 1 , . . . , n R n are the vectors representing measures on X , Y S Z . (ii) Φ = ( ϕ ) i , j R m × n represents the transport plan which transport ( ϕ ) i , j amount of mass from f i to g j . (iii) C = ( c ) i , j R m × n represents the unit cost of transporting from f i to g j . (iv) M X R m × m n , M Y R n × n m represents the constraints to satisfy marginal. (v) F l a t ( α ) = β is some function that flatten matrix α R m × n into vector β R k = m × n . Note that flatten function is one-to-one.
For example, as shown in Figure 4, the sum of colum of ϕ must equal to the mass above, and the sum of row of ϕ must equal to the mass at the left. The C is the unit cost of each possible transport pair. The problem is to minimize the cost while satisfying the (1) equality of ϕ and (2) mass above and on the left.

3. Problem Formulation

3.1. Core Problem

The core problem this research seeks to address is the accurate detection of welding defects in PCBs in gas meter while overcoming the limitations of traditional methods. To tackle this problem, we reformulate the PCB welding defect detection challenge as an image comparison task using optimal transport (OT) theory. Specifically:
  • Input: Two local images—one representing the reference (defect-free) welding area on PCB and the other representing the welding area on PCB under inspection.
  • Objective: Identify any discrepancies between the reference image and the test image, which may correspond to welding defects.
  • Constraints:
    (a)
    Achieving high precision in detecting small, subtle welding defects.
    (b)
    Reducing dependency on large, labeled datasets for training detection algorithms
    (c)
    Providing interpretability of defect to enable actionable insights for defect tracing, process improvement, and product repair.

3.2. Formulation of Discrete Optimal Transport Problem

We suppose the 2 dimensional image of the detecting image and the reference image are both in the size of d 1 × d 2 pixels for some d 1 , d 2 N , say
X , Y Z × Z
respectively. Since X , Y are in same size, we can easily transform X to Y by elementary arithmetic, thus we assume X = Y . Similarly, we assume
X = Y = { ( x , y ) : x [ 0 , d 1 1 ] , y [ 0 , d 2 1 ] }
Consider the gray scale
S g r a y = { 0 , 1 , 2 , . . . , κ }
for some κ N represents the brightness of the image, where 0 and κ represent the darkest and brightest respectively.
We consider f * , g * to be densities on X , Y such that for all x X , y Y , we have f * ( x ) , g * ( y ) S g r a y . By normalizing f * , g * , we have the normalized image (density/measure) of the detecting image f and reference image g where
f ( x ) = f * ( x ) α X f * ( α ) g ( y ) = g * ( y ) β Y g * ( β )
Then the optimal transport problem is as follows:
C o p t i m a l = min { X × Y c ( x , y ) d γ ( x , y ) | γ Π ( f , g ) } c = x y 2
where the cost function c is the Euclidean distance. If C o p t i m a l exist, it is the optimal transport cost and the map γ is the optimal transport map.
Table 1. Notations in Problem Formulation.
Table 1. Notations in Problem Formulation.
Notation Description
d 1 × d 2 The size in pixel of the input image
X The 2 dimensional coordinates for each pixel in detecting image
Y The 2 dimensional coordinates for each pixel in reference image
S g r a y The set of gray scale
κ Maximum of gray scale
f * The measure on X representing the gray sacle detecting image
g * The measure on Y representing the gray sacle reference image
f The normalized measure of f * on X
g The normalized measure of g * on Y
C o p t i m a l The optimal cost of transporting f to g

3.3. Solvability of the Assignment Problem

Clearly, any f ( x ) , g ( y ) can be considered as
n σ X σ Y = n ( α X f * ( α ) ) ( β Y g * ( β ) ) Q
So both f , g could be considered as some sum of Dirac masses in same scale ( 1 / σ X σ Y ). Note that
x X f ( x ) = y Y g ( y ) = 1
which implies that the discrete optimal transport problem could be solved [18]. This could be cone by algorithm such as transportation simplex [28], Hungarian [29], auction [30], etc.

3.4. Properties of the Assignment Problem

As shown above, the assignment problem has some properties as follows:
  • To solve the assignment problem does not need any outside information beside the detecting image and reference image.
  • By solving the assignment, any slight difference between two image would be included in the transport plan and also represented by the optimal transport cost.
  • The optimal transport plan is two-way since the cost is Euclidean, thus the plan could show that how can the detecting image be transported to the reference image and vice versa.

4. Solver Design

4.1. 2 Dimensional to 1 Dimensional

For further simplicity, we could transform the assignment problem in Section 3 to 1 dimensional form. We first consider a transform function T : X N such that
T ( x , y ) = x + d 2 y
Clearly, T is bijective. Denote k = d 1 d 2 1 , and we let D = T ( X ) = [ 0 , k ] N to be the 1 dimensional frame for images of detecting image and reference image, and we let f ^ , g ^ to be the 1 dimensional representation of the images where f ^ ( x ) = f ( T 1 ( x ) ) and g ^ ( y ) = g ( T 1 ( y ) ) . Then the assignment problem becomes
min i , j D x i , j c i , j s . t . j D x i , j = f ^ ( i ) , i D i D x i , j = g ^ ( j ) , j D
where x i , j represents the mass transports from T 1 ( i ) to T 1 ( j )
c i , j = T 1 ( i ) T 1 ( j ) 2
Table 2. Notations in Encoding and Decoding.
Table 2. Notations in Encoding and Decoding.
Notation Description
T The bijective (2D to 1D) flatten function
k The number of pixels minus one
D The 1 dimensional coordinates for the gray scale of both input images
f ^ The measure on D representing the gray scale detecting image
g ^ The measure on D representing the gray scale reference image
c i , j The unit cost for transporting from ith coordinate to jth coordinate in D
x i , j The mass to transport from ith coordinate to jth coordinate in D
i , j D The cost of a transport
j D x i , j Mass conservation constraints for detecting image at ith coordinate in D
= f ^ ( i )
i D x i , j Mass conservation constraints for reference image at jth coordinate in D
= g ^ ( j )
C The cost map
X The transport plan
A The constraint matrix which project X to vector in D D T
B The constraint vector represents the gray scale at each point for both image

4.2. Assignment Problem to Linear Programming Problem

Since for any i , j , c i , j is fixed, we can consider
C = [ c 0 , 0 , c 0 , 1 , . . . , c 0 , k , c 1 , 0 , . . . , c k , k ] X = [ x 0 , 0 , x 0 , 1 , . . . , x 0 , k , x 1 , 0 , . . . , x k , k ]
and
A = I 0 0 0 I 0 0 0 I I 0 I 0 I 0 I 1 I 1 I 1 I k I k I k B = f ^ ( 1 ) f ^ ( 2 ) f ^ ( k ) g ^ ( 1 ) g ^ ( 2 ) g ^ ( k )
such that
I = [ 1 , 1 , . . . , 1 , 1 ] R k I 0 = [ 1 , 0 , . . . , 0 , 0 ] R k I 1 = [ 0 , 1 , . . . , 0 , 0 ] R k I k = [ 0 , 0 , . . . , 0 , 1 ] R k
Then we can reformulate the assignment problem as follows
min X 0 C · X s . t . A X = B
Note that the problem here is a standard linear programming (LP) problem [31], thus it can be solved by standard method such as dual simplex method [32], interior point method [33], etc.

5. Discrete Optimal Transport Based Welding Defect Detection Method

5.1. Method Overview

As shown in Figure 5, we gather two images from various ways and by various equipment. One of them is the detecting image and another is the reference image. Then we find the welding area for the component to detect, and cut both images into the same welding area.
To lower the time consumption, we then resize both images into some convenient size without losing too much precision, and we transform the image into gray scale image. Next, we use matrix to represent every pixel in gray scale image, and we normalize the matrix.
The matrix could be considered as measures over some domain D o m Z 2 , and we could let Euclidean distance to be the transport cost. By doing so, we form an optimal transport problem. To solve the problem, we project the domain D o m to one dimension, say D o m 2 Z , by some bijection. Then we formulate the transport map T m a p in size of D o m 2 × D o m 2 representing how much mass is transport from detecting image to the reference image at each pixel. By such a variable matrix, we then generate a corresponding cost matrix C representing the unit cost for every transport. Flattening the map T m a p and cost C, taking dot product would result the cost of transport. Adding constraints of mass conservation, then the optimal transport problem becomes a simple minimizing problem subject to constraints.
By solving the minimization problem, we get the optimal transport map. Using the map, we can have the optimal transport cost, and optimal transport path from detecting image to reference image.

5.2. Image to Matrix

We assume that the input image is in same size as it is assumed in Section 3.2. We also assume that the input image can be formulated as pixels of some ratio (0-255) of red, green, and blue (RGB). Therefore, an image in RGB can be considered as a matrix where each element is a vector in N 3 . For example:
Preprints 137895 i001

5.3. Find Welding Area

Since the components on PCB have distinct color in comparison to the color of PCB, we consider matrix R , G , B having same size as the RGB matrix such that R , G , B contain only R,G,B value in RGB matrix respectively. We define
N ( M , i , j , k ) = 1 ( 2 k + 1 ) 2 q [ k , k ] m i + q , j + q s . t . i ± k [ 0 , m ] j ± k [ 0 , n ]
for i , j , k N , M R m × n , which represents the average value for elements near the element at ith row jth column of matrix M. Then for the R , G , B , say they all have size m × n , we consider c = ( c 1 , c 2 ) = ( m 2 , n 2 ) represents the relative center element of the matrix. Let
l 1 = { ( 0 , c 2 ) , ( 1 , c 2 ) , . . . , ( m , c 2 ) } l 2 = { ( c 1 , 0 ) , ( c 1 , 1 ) , . . . , ( c 1 , n ) } l 3 = { ( 0 , 0 ) , ( 1 , 1 × n m ) , ( 2 , 2 × n m ) , . . . , ( m , m × n m ) } l 4 = { ( m , 0 ) , ( m 1 , n 1 × n m ) , ( 2 , 2 × n m ) , . . . , ( 0 , n m × n m ) }
be four sets of elements in R (horizontal, vertical, and diagonal element w.r.t. c in R). Let some k N such that k min { m 8 , n 8 } , and consider
v 1 ( x ) = ( x + k , c 2 ) , x [ 0 , m 2 k ] v 2 ( x ) = ( c 1 , x + k ) , x [ 0 , n 2 k ] v 3 ( x ) = ( x + k , ( x + k ) × n m ) , x [ 0 , m 2 k ] v 4 ( x ) = ( m ( x + k ) , n ( m ( x + k ) ) × n m ) , x [ 0 , m 2 k ]
Define V 1 , V 2 , V 3 , V 4 with same domain as v 1 , v 2 , v 3 , v 4 respectively such that
V α ( x ) = N ( R , i , j , k ) ( i , j ) = v α ( x )
Let some δ , γ , ω R to be the threshold that represents the red value range for the component body and the red value for text on it or other color on it if exist. Consider V 1 , V 2 , V 3 , V 4 such that
V α = 0 , δ V α ( x ) < γ 0 , ω V α ( x ) 1 , o t h e r w i s e
Then for V 1 , V 2 , V 3 , V 4 , let λ 11 , λ 12 , . . . , λ 41 , λ 42 to be the values farthest (but connected) from the center of domain which maps to 0 respectively. For rectangle component, we could have the welding area A 1 , . . . , A 8 as follows:
Preprints 137895 i002
And for component in other shape such as round, we could have the welding area A 1 , . . . , A 8 as follows:
Preprints 137895 i003
The welding area matrix A i is defined to be in same shape with R, but every element outside of the welding area is valued by 1 .
Similarly, we take some k , δ , γ , ω , and then we could find two other sets of A 1 , . . . , A 8 for green matrix and blue matrix G , B . Denoting the welding area of R , G , B to be A 1 R , . . . , A 8 R , A 1 G , . . . , A 8 G , A 1 B , . . . , A 8 B respectively. They we say A 1 * , . . . , A 8 * defined by
( a α * ) i , j
= ( R = 1 , G = 1 , B = 1 ) , i f min { ( a α R ) i , j , ( a α G ) i , j , ( a α B ) i , j } = 1 ( R = ( a α R ) i , j , G = ( a α G ) i , j , B = ( a α B ) i , j ) , o t h e r w i s e
to be the welding area.

5.4. Refine Welding Area

Now suppose we have W 1 , W 2 , . . . to be the welding areas where W β is some combination of element in A 1 * , . . . , A 8 * . Since the PCB is in green, we consider function S r ( M , j ) , S c ( M , i ) which take the average of elements with non-negative value in jth row and ith column of matrix M, such that the average is defined by a v g ( x 1 , . . . , x n ) = ( R = i n x i R n , G = i n x i G n , B = i n x i B n ) for x i = ( R = x i R , G = x i G , B = x i B )
For each welding area, we could change the value of every element in ith column to ( R = 1 , G = 1 , B = 1 ) if
S c ( R , i ) = ( R = S 1 , G = S 2 , B = S 3 ) s a t i s f y S 1 G r e e n R S 2 G r e e n G S 3 G r e e n B
for G r e e n R , G r e e n G , G r e e n B is the color range of the PCB. Similarly, we change value at jth column to ( R = 1 , G = 1 , B = 1 ) if
S r ( R , i ) = ( R = S 1 , G = S 2 , B = S 3 ) s a t i s f y S 1 G r e e n R S 2 G r e e n G S 3 G r e e n B
Taking (5.6) as an example, the process would be as follows:
Preprints 137895 i004

5.5. RGB to Normalized Gray Scale

We use the formula G r a y s c a l e = 0.299 R + 0.587 G + 0.114 B as discussed in [34] to transform welding area matrix W 1 , . . . into gray scale matrix. For example, if we now let the example discussed in Section 5.2 to be the non-negative part of welding area matrix, we will have the following:
R = 219 , G = 48 , B = 122 R = 103 , G = 12 , B = 77 R = 66 , G = 200 , B = 187 R = 0 , G = 255 , B = 0
Preprints 137895 i005
where the element with ( R = 1 , G = 1 , B = 1 ) is transformed to 1
Next, we normalize the gray scale matrix where we let the sum of all non-negative element in the matrix to be 100 by letting the element at ith row jth column in normalized gray scale matrix to be
m i , j * = 1 , m i , j = 1 100 × m i , j r , s max { m r , s , 0 } , o t h e r w i s e
where m i , j is the element at ith row jth column in gray scale matrix. In this example, we will have the
23.2671 10.0838 34.2724 32.3767

5.6. Matrix to 2D Measure

While we have a normalized gray scale welding matrix, we can consider the matrix as a space in N 2 where the gray scale value to be the measure on the space. Namely, let
Z = [ 0 , m 1 ] × [ 0 , n 1 ] N 2
and
h : Z R + s . t . h ( i , j ) = m i , j * , m i , j * 0 0 , o t h e r w i s e ( i , j ) X
To eliminate the unnecessary part and keep only the welding area, we consider
X * = [ a , b ] × [ c , d ] Z
to be the smallest rectangle to contain every element z Z satisfy h ( z ) > 0 . Consider mapping m o r i g i n ( x , y ) = ( x a , y b ) that maps X * to [ 0 , b a ] × [ 0 , d c ] . We could then use
Φ ( x ) = h ( m o r i g i n ( x ) ) x [ 0 , b a ] × [ 0 , d c ]
to represent the welding area.
With the same example as above subsection, we could have
[ 0 , b a ] × [ 0 , d c ] = [ 0 , 1 ] × [ 0 , 1 ] N 2 Φ ( 0 , 1 ) = 23.2671 Φ ( 1 , 1 ) = 10.0838 Φ ( 0 , 0 ) = 34.2724 Φ ( 1 , 0 ) = 32.3767

5.7. Resizing 2D Measure

In order to avoid high computational cost, we could resize the detecting welding area by considering
X = [ 0 , σ 1 1 ] × [ 0 , σ 2 1 ]
and
μ 1 = b a σ 1 ν 1 = b a σ 1 μ 1 μ 2 = d c σ 2 ν 2 = d c σ 2 μ 2
with
f ( x , y ) = Φ ( x , y ) , ( x , y ) = ( 0 , 0 ) Φ ( x , y ) , ( x , y ) = ( 0 , σ 2 1 ) Φ ( x , y ) , ( x , y ) = ( σ 1 1 , 0 ) Φ ( x , y ) , ( x , y ) = ( σ 1 1 , σ 2 1 ) φ ( x , y ) , o t h e r w i s e
for
φ ( x , y ) = i μ 1 , j μ 2 Φ ( ( μ 1 + ν 1 ) x + i , ( μ 2 + ν 2 ) y + j ) ( μ 1 + 1 ) ( μ 2 + 1 ) + μ 1 + μ 2 + 1 + ν 2 i μ 1 Φ ( ( μ 1 + ν 1 ) x + i , ( μ 2 + ν 2 ) y + μ 2 + 1 ) ( μ 1 + 1 ) ( μ 2 + 1 ) + μ 1 + μ 2 + 1 + ν 1 j μ 2 Φ ( ( μ 1 + ν 1 ) x + μ 1 + 1 , ( μ 2 + ν 2 ) y + j ) ( μ 1 + 1 ) ( μ 2 + 1 ) + μ 1 + μ 2 + 1 + ν 1 ν 2 Φ ( ( μ 1 + ν 1 ) x + μ 1 + 1 , ( μ 2 + ν 2 ) y + μ 2 + 1 ) ( μ 1 + 1 ) ( μ 2 + 1 ) + μ 1 + μ 2 + 1
which takes averages for neighbor measure.
Then we could represent the shrank or resized welding area’s measure by ( f , X ) .

5.8. 2D Measure to 1D Measure

As discussed in Section 4.1, since the element is finite, we can easily construct the flatten function T . Applying T to the space X, we can get the 1D space D . Assign element d D with measure f on T 1 ( d ) , denoting as f ^ . Then we have the 1D flat version ( D , f ^ ) from 2D version (X,f).
With the same example as above, we have d 2 = d 2 = 2 , which leads to
D = [ 0 , 1 , 2 , 3 ] w h e r e f ^ ( 1 ) = 23.2671 f ^ ( 3 ) = 10.0838 f ^ ( 0 ) = 34.2724 f ^ ( 2 ) = 32.3767

5.9. 1D Measure to Discrete OT Problem

Followed by the previous steps, two input images would be transformed into two 1D measures on some D . As discussed in Section 4.1, we then construct the 1D discrete optimal transport problem as formulated in (8) and (9).
If we inherit the example used in previous subsections to be the original image, and we arbitrarily let
g ^ ( 1 ) = 10 g ^ ( 3 ) = 30 g ^ ( 0 ) = 20 g ^ ( 2 ) = 40
to be the 1D measure representing the objective image. Then we will have some transport plans and transport cost as shown in Table 3 and Table 4.
Then the discrete optimal transport problem is to find the transport plan that minimizes i , j 3 x i , j c i , j satisfying the marginal, namely the sum of each column equals to the value above and the sum of each row equals to the value on the left.

5.10. Discrete OT Problem to LP Problem

As discussed in Section 4.2, we could construct the minimizing problem as in (13). Followed by the example, we will have
A = 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 1 0 0 0 1 1 R 8 × 16 B = 34.2724 23.2671 32.3767 10.0838 20 10 30 40 R 8
and
C = ( 0 , 1 , 1 , 2 , 1 , 0 , 2 , 1 , 1 , 2 , 0 , 1 , 2 , 1 , 1 , 0 )
X = ( x 0 , 0 , x 0 , 1 , x 0 , 2 , x 0 , 3 , . . . , x 3 , 0 , x 3 , 1 , x 3 , 2 , x 3 , 3 )

5.11. LP Problem Solution to Optimal Cost and Optimal Plan

Solving the LP problem gives argmin, which corresponds to the optimal transport map. Suppose X * is the solution to the LP problem, then X * C is the optimal transport cost. For x i , j X * , moving x i , j amount of mass from T 1 ( i ) to T 1 ( j ) is the optimal transport plan.
For the same example, the solution to the constrained minimization problem is given by
X * = ( 20 , 0 , 0 , 14.2724 , 0 , 10 , 0 , 13.2671 , 0 , 0 , 30 , 2.3767 , 0 , 0 , 0 , 10.0838 )
which can be reformulated as in Table 5.
Applying T 1 to the plan, we finally get the transport plan from measure f to measure g.
( 0 , 0 ) ( 0 , 0 ) 20 ( 0 , 0 ) ( 1 , 1 ) 14.2724 ( 0 , 1 ) ( 0 , 1 ) 10 ( 0 , 1 ) ( 1 , 1 ) 13.2671 ( 1 , 0 ) ( 1 , 0 ) 30 ( 1 , 0 ) ( 1 , 1 ) 2.3767 ( 1 , 1 ) ( 1 , 1 ) 10.0838

5.12. Intermediate Images

For each assignment, we can consider moving path p i , j ( t ) where p i , j ( 0 ) = T 1 ( i ) is the initial position and p i , j ( 1 ) = T 1 ( j ) is the final position. Then for intermediate status t ( 0 , 1 ) , the mass is located at p i , j ( t ) . For each assignment, finding the closest coordinate add the transporting mass x i , j to the position, then subtracting from the initial position would give a intermediate image representing the moving status at time t = t according to the optimal transport plan.

6. Experimental Result and Discussion

The proposed Discrete Optimal Transport Based Welding Defect Detection Method is implemented in Python 3.11.4. The experimental configuration is Intel Core i9-13900K CPU @5.00 GHz with 128 GB memory and RTX 4070 Ti GPU. The test data are gathered from real PCB manufacturing line of intelligent gas meter from Qinchuan IoT Technology Co.,Ltd. In this section, we will show the following advantages of the proposed method from real welding status for components on PCB.
  • (Precision) Sensitivity to slight change in image
  • (Efficiency) Computational cost comparison for entire component and only welding part
  • (Independency) Do not need large training data sets
  • (Directivity) Can provide actionable insights for manufacturing process improvement and product repair

6.1. Image Gathering

For each PCB manufactured, we take a picture from the above. Since the position of PCB in image stay in some range, and also the component to detect stay in some range in PCB, we can easily get a relative small area containing the component (as shown in Figure 6).

6.2. Sample And Standard Image

Since for each component, there is a white rectangle-like box containing the component, we can then get the cleaner image of the detecting component by methods such as finding contours. Then we can compare the image (Figure 7) with the standard image (Figure 8). Note that the standard image could come from various origin such as previous qualified product, simulation, etc.

6.3. Find Welding Area

Once we obtained the detecting component, we first transform the RGB image into RGB matrix as discussed in Section 5.2. Since we know the detecting component is in rectangle shape, we then use the Welding Area Finding method discussed in Section 5.3 with
k = 2 δ R = δ G = δ B = 30 γ R = γ G = γ B = 60 ω R = ω G = ω B = 100
where taking λ 11 , λ 12 , λ 21 , λ 22 to be the farthest value mapped to 0 by V 1 , V 2 . Then we take A 1 * A 8 * A 7 * and A 3 * A 4 * A 5 * to be detecting welding areas (as shown in Figure 9, the welding areas are L and R). Then, with the same λ and A * , we also find the detecting welding area for the reference image as follows in Figure 10.

6.4. Defect Detection

Following the method discussed from Section 5.4 to 5.12, we could compare the right detecting welding area with the right welding area of the standard image, and for the left welding area, we compare with the left welding area of the standard image.
As shown in the Table 6, Table 7 and Table 8, the practical time complexity of solving optimal transport problem in the proposed method is approximately O ( n 3 ) . Thus by localizing the welding area, we significantly lower the computational cost with no harm in precision.
Also, the proposed method is extremely sensitive to slight defect. As we can see that the similar welding images in Figure 7 results in very different optimal transport cost. Any small difference in measure will reflect on the optimal transport plan since the mass change need to be transported out or filled in. This can be illustrated very clearly by Figure 11, Figure 12, Figure 13 and Figure 14. The difference in detecting welding area will be represented by different measure (or we could consider it as different mass distribution) and to find the optimal transport plan will need to deal with these differences. A small difference could result in different transport plan for a large neighborhood of such a difference.
This can be supported by the Table 9, where the result in optimal transport cost change is based on changing the gray scale value for some randomly chosen point(s) in the detecting welding area. Note that if the change exceed the min and max of 0 and 255, then the changed value will be limited in the range
Therefore, another advantage of only detecting the welding area is that it could avoid the error due to the pattern or text on detecting component. For example, in Figure 15 and Figure 16, the optimal transport plan need to consider the mass for the text printed on the component, even the text is unimportant.
Looking at the optimal cost for same set of samples with different resized size in Table 6 and Table 7, we could see that while the resolution of detecting welding area increases 4 times, the optimal cost approximately doubles. This is due to the Euclidean transport cost we chose. It also shows that reasonably resizing the size does not harm precision very much.
Note that the only input data we need is two images: the detecting image and reference image. During the detecting process, there is no outside data used. The welding area finding process, image resizing process, optimal transport problem generating process, etc. are all done locally. The independency on large training data set allow this method to omit the training process and to be applied in data scarce welding defect detecting scene.
Finally, the method not only compare two imagess’ difference, but also gives a path for one image to transform to another. As shown in Figure 11, Figure 12, Figure 13 and Figure 14, the method unveil the possible way for the detecting welding area to become ideal based on 2D image. It may also help to trace back to potential issues in manufacturing process. For example, if a batch of PCB all has problem on the same component, and the optimal transport path shows the similar mass moving trends, then it is very possible that the welding strategy of the welding machine has issue when dealing with this component. By considering the optimal transport path, the welding machine may add deviation to its strategy based on the path.

7. Conclusions

This study addressed the lack of welding defect detecting method that could maintain precision, be independent to training data, relatively cost low in computation, and guide the potential issue tracing in manufacturing process and the afterwards repair. An welding defect detecting method based on discrete optimal transport was proposed. First, the discrete optimal transport problem based on image comparison was established, and a solver transforming discrete optimal transport problem to linear programming problem was designed to solve the discrete optimal transport problem. Second, a method to process the input detecting image to matrix and then finding the welding area was proposed. In this method, images were transformed into RGB matrix, and by detecting the edges of component, the welding areas were derived from the matrix. Third, a way to transform matrix into 2D measure on N 2 was proposed. The welding area is defined in measure and the non-welding area is eliminated from the domain. Fourth, a resizing model is proposed to resize the measure on N 2 into smaller domain was proposed. It takes the weighted average over the neighborhood in order to summarize the information. Finally, with the resized 2D measure, the discrete optimal transport problem can be formulated and solved by the solver. According to the optimal transport plan, the transport path from the image of detecting welding area to the image of standard welding area could be generated, as well as the intermediate status.
However, there also exist some limitations for this method. Although the time complexity in practice is not bad, the time consumption remains high when the size of image is large since the variable is the square of total pixels of the image. Considering continuous transport or semi-continuous transport may benefits in some cases. Another limitation is that the method proposed in this paper only analyzes a 2 dimensional image. It is possible that the images of same object are different due to the different position of camera. Using multiple images to form a 3 dimensional density and finding the optimal transport may be the way to solve it.

Funding

This research received no external funding

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data used in this study are openly available in GitHub at https://github.com/hanshushao123/DataSharing under folder “A Discrete Optimal Transport Based Melding Defect Detection Method for PCB in Gas Meter”.

Acknowledgments

I would like to sincerely thank Professor Weizhi Liao from University of Electronic Science and Technology of China for her guidance and help.

Conflicts of Interest

The author declare no conflicts of interest.

References

  1. Li, F.; Wu, X.; Phillips, M.A. Technical efficiency of the urban gas industry in china. Environmental Science and Pollution Research 2023, 30, 104477–104488. [Google Scholar] [CrossRef] [PubMed]
  2. Huang, L. City natural gas metering. Natural Gas—Extraction to End Use; Gupta, SB, Ed.; InTech: Rijeka, Croatia, 2012; pp. 181–208. [Google Scholar]
  3. Zehua, S. Intertet of Things And Smart City; Renmin Unviersity of China Press, 2022.
  4. Webster, J.G.; Eren, H. Measurement, Instrumentation, and Sensors Handbook: Two-Volume Set; CRC press, 2018.
  5. Sun, Q.; Li, H.; Ma, Z.; Wang, C.; Campillo, J.; Zhang, Q.; Wallin, F.; Guo, J. A comprehensive review of smart energy meters in intelligent energy networks. IEEE Internet of Things Journal 2015, 3, 464–479. [Google Scholar] [CrossRef]
  6. Ilea, P.; Săvescu, D.; Stoica, A. Some aspects of gas meter quality and analyzing the sustainability of a gas meter element. In Proceedings of the IOP Conference Series: Materials Science and Engineering. IOP Publishing, 2019, Vol. 568, p. 012063.
  7. Wu, R.; Backus, S.; Basu, I.; Blanchard, P.; Brice, K.; Dryfhout-Clark, H.; Fowlie, P.; Hulting, M.; Hites, R. Findings from quality assurance activities in the Integrated Atmospheric Deposition Network. Journal of Environmental Monitoring 2009, 11, 277–296. [Google Scholar] [CrossRef] [PubMed]
  8. Hacke, P.; Lokanath, S.; Williams, P.; Vasan, A.; Sochor, P.; TamizhMani, G.; Shinohara, H.; Kurtz, S. A status review of photovoltaic power conversion equipment reliability, safety, and quality assurance protocols. Renewable and Sustainable Energy Reviews 2018, 82, 1097–1112. [Google Scholar] [CrossRef]
  9. Kavitha, R.; Akshatha, K. Component identification and defect detection of printed circuit board using artificial intelligence. In Proceedings of the 2023 2nd International Conference on Applied Artificial Intelligence and Computing (ICAAIC). IEEE. 2023; pp. 100–106. [Google Scholar]
  10. Sezer, A.; Altan, A. Optimization of deep learning model parameters in classification of solder paste defects. In Proceedings of the 2021 3rd international congress on human-computer interaction, optimization and robotic applications (HORA). IEEE. 2021; pp. 1–6. [Google Scholar]
  11. Chen, I.C.; Hwang, R.C.; Huang, H.C. Pcb defect detection based on deep learning algorithm. Processes 2023, 11, 775. [Google Scholar] [CrossRef]
  12. Chen, X.; Wu, Y.; He, X.; Ming, W. A comprehensive review of deep learning-based PCB defect detection. IEEE Access 2023. [Google Scholar] [CrossRef]
  13. Ling, Q.; Isa, N.A.M. Printed circuit board defect detection methods based on image processing, machine learning and deep learning: A survey. IEEE Access 2023, 11, 15921–15944. [Google Scholar] [CrossRef]
  14. Baygin, M.; Karakose, M.; Sarimaden, A.; Erhan, A. Machine vision based defect detection approach using image processing. In Proceedings of the 2017 international artificial intelligence and data processing symposium (IDAP). Ieee. 2017; pp. 1–5. [Google Scholar]
  15. Chang, Y.; Xue, Y.; Zhang, Y.; Ma, J.; Li, G.; Wu, D.; Zhan, Q.; Zuo, J. Research on PCB solder joint defect detection method based on machine vision. In Proceedings of the Fourteenth International Conference on Graphics and Image Processing (ICGIP 2022). SPIE, 2023. Vol. 12705; pp. 181–188.
  16. Bhatt, P.M.; Malhan, R.K.; Rajendran, P.; Shah, B.C.; Thakar, S.; Yoon, Y.J.; Gupta, S.K. Image-based surface defect detection using deep learning: A review. Journal of Computing and Information Science in Engineering 2021, 21, 040801. [Google Scholar] [CrossRef]
  17. Liu, G. Surface defect detection methods based on deep learning: a brief review. In Proceedings of the 2020 2nd International Conference on Information Technology and Computer Application (ITCA). IEEE. 2020; pp. 200–203. [Google Scholar]
  18. Kantorovich, L.V. On the Translocation of Masses. Journal of mathematical sciences 2006, 133. [Google Scholar] [CrossRef]
  19. Liu, Z.; Qu, B. Machine vision based online detection of PCB defect. Microprocessors and Microsystems 2021, 82, 103807. [Google Scholar] [CrossRef]
  20. Ren, Z.; Fang, F.; Yan, N.; Wu, Y. State of the art in defect detection based on machine vision. International Journal of Precision Engineering and Manufacturing-Green Technology 2022, 9, 661–691. [Google Scholar] [CrossRef]
  21. Liao, S.; Huang, C.; Zhang, H.; Gong, J.; Li, M.; Wang, Z. Object detection of welding defects in SMT electronics production based on deep learning. In Proceedings of the 2022 23rd International Conference on Electronic Packaging Technology (ICEPT). IEEE, 2022. pp. 1–5.
  22. Legon, A.; Deo, M.; Albin, S.; Audette, M. Detection and classification of PCB defects using deep learning methods. In Proceedings of the 2022 IEEE 31st Microelectronics Design & Test Symposium (MDTS). IEEE, 2022. pp. 1–6.
  23. Liu, X.; Wang, J.; Zhang, R.; Ruan, W. Deep learning-based defect detection for printed circuit boards. In Proceedings of the Third International Conference on Computer Vision and Pattern Analysis (ICCPA 2023). SPIE, 2023. Vol. 12754; pp. 897–902.
  24. Ling, Z.; Zhang, A.; Ma, D.; Shi, Y.; Wen, H. Deep Siamese semantic segmentation network for PCB welding defect detection. IEEE Transactions on Instrumentation and Measurement 2022, 71, 1–11. [Google Scholar] [CrossRef]
  25. Pham, T.T.A.; Thoi, D.K.T.; Choi, H.; Park, S. Defect detection in printed circuit boards using semi-supervised learning. Sensors 2023, 23, 3246. [Google Scholar] [CrossRef] [PubMed]
  26. Mémoli, F. Gromov–Wasserstein distances and the metric approach to object matching. Foundations of computational mathematics 2011, 11, 417–487. [Google Scholar] [CrossRef]
  27. Colombo, M.; Di Marino, S. Equality between Monge and Kantorovich multimarginal problems with Coulomb cost. Annali di Matematica Pura ed Applicata (1923-) 2015, 194, 307–320. [Google Scholar] [CrossRef]
  28. Dantzig, G.B. Linear programming and extensions. In Linear programming and extensions; Princeton university press, 2016.
  29. Kuhn, H.W. The Hungarian method for the assignment problem. Naval research logistics quarterly 1955, 2, 83–97. [Google Scholar] [CrossRef]
  30. Bertsekas, D.P. The auction algorithm: A distributed relaxation method for the assignment problem. Annals of operations research 1988, 14, 105–123. [Google Scholar] [CrossRef]
  31. Evans, L.C. Partial differential equations and Monge-Kantorovich mass transfer. Current developments in mathematics 1997, 1997, 65–126. [Google Scholar] [CrossRef]
  32. Banciu, M. Dual simplex. In Wiley Encyclopedia of Operations Research and Management Science; Wiley, 2011.
  33. Potra, F.A.; Wright, S.J. Interior-point methods. Journal of computational and applied mathematics 2000, 124, 281–302. [Google Scholar] [CrossRef]
  34. Alrubaie, S.H.; Hameed, A.H. Dynamic weights equations for converting grayscale image to RGB image. Journal of University of Babylon for Pure and Applied Sciences 2018, 26, 122–129. [Google Scholar] [CrossRef]
Figure 1. Given two terrains defined as probability density f , g , where represented as gray scale here, Monge’s problem is to minimize the cost of transforming the terrain represented by f into terrain represented by g. The transport plan T need to satisfy the mass conservation constraint, where any random portion in density g must be transported from some portion with same mass in density f.
Figure 1. Given two terrains defined as probability density f , g , where represented as gray scale here, Monge’s problem is to minimize the cost of transforming the terrain represented by f into terrain represented by g. The transport plan T need to satisfy the mass conservation constraint, where any random portion in density g must be transported from some portion with same mass in density f.
Preprints 137895 g001
Figure 2. For any transport plan to transport f to g = g 1 + g 2 , there exist better plan by splitting f into twice more pieces. So that there exist no optimal transport plan. This is since transport plan T cannot send same point, say x, to two different places, say y 1 , y 2 .
Figure 2. For any transport plan to transport f to g = g 1 + g 2 , there exist better plan by splitting f into twice more pieces. So that there exist no optimal transport plan. This is since transport plan T cannot send same point, say x, to two different places, say y 1 , y 2 .
Preprints 137895 g002
Figure 3. Kantorovitch’s Relaxed Problem Example
Figure 3. Kantorovitch’s Relaxed Problem Example
Preprints 137895 g003
Figure 4. One Dimensional Discrete Optimal Transport Problem Example
Figure 4. One Dimensional Discrete Optimal Transport Problem Example
Preprints 137895 g004
Figure 5. An Overview.
Figure 5. An Overview.
Preprints 137895 g005
Figure 6. The Detecting Component
Figure 6. The Detecting Component
Preprints 137895 g006
Figure 7. Sample Images
Figure 7. Sample Images
Preprints 137895 g007
Figure 8. Standard Image
Figure 8. Standard Image
Preprints 137895 g008
Figure 9. Welding Area of Sample 3
Figure 9. Welding Area of Sample 3
Preprints 137895 g009
Figure 10. Welding Area of Standard Image
Figure 10. Welding Area of Standard Image
Preprints 137895 g010
Figure 11. Left Part Comparison of Sample 3 (Optimal Cost: 56.70).
Figure 11. Left Part Comparison of Sample 3 (Optimal Cost: 56.70).
Preprints 137895 g011
Figure 12. Right Part Comparison of Sample 3 (Optimal Cost: 69.93).
Figure 12. Right Part Comparison of Sample 3 (Optimal Cost: 69.93).
Preprints 137895 g012
Figure 13. Left Part Comparison of Sample 7 (Optimal Cost: 146.81).
Figure 13. Left Part Comparison of Sample 7 (Optimal Cost: 146.81).
Preprints 137895 g013
Figure 14. Right Part Comparison of Sample 7 (Optimal Cost: 57.54).
Figure 14. Right Part Comparison of Sample 7 (Optimal Cost: 57.54).
Preprints 137895 g014
Figure 15. Sample 1 in Defect Detect For Single Component (Optimal Cost: 55.71).
Figure 15. Sample 1 in Defect Detect For Single Component (Optimal Cost: 55.71).
Preprints 137895 g015
Figure 16. Sample 7 in Defect Detect For Single Component (Optimal Cost: 66.03).
Figure 16. Sample 7 in Defect Detect For Single Component (Optimal Cost: 66.03).
Preprints 137895 g016
Table 3. Transport Plan.
Table 3. Transport Plan.
g ^ ( 0 ) = 20 g ^ ( 1 ) = 10 g ^ ( 2 ) = 30 g ^ ( 3 ) = 40
f ^ ( 0 ) = 34.2724 x 0 , 0 x 0 , 1 x 0 , 2 x 0 , 3
f ^ ( 1 ) = 23.2671 x 1 , 0 x 1 , 1 x 1 , 2 x 1 , 3
f ^ ( 2 ) = 32.3767 x 2 , 0 x 2 , 1 x 2 , 2 x 2 , 3
f ^ ( 3 ) = 10.0838 x 3 , 0 x 3 , 1 x 3 , 2 x 3 , 3
Table 4. Transport Cost (Euclidean Distance).
Table 4. Transport Cost (Euclidean Distance).
0 1 2 3
0 c 0 , 0 = 0 c 0 , 1 = 1 c 0 , 2 = 1 c 0 , 3 = 2
1 c 1 , 0 = 1 c 1 , 1 = 0 c 1 , 2 = 2 c 1 , 3 = 1
2 c 2 , 0 = 1 c 2 , 1 = 2 c 2 , 2 = 0 c 2 , 3 = 1
3 c 3 , 0 = 2 c 3 , 1 = 1 c 3 , 2 = 1 c 3 , 3 = 0
Table 5. Optimal Transport Plan (Optimal Cost: 35.7679).
Table 5. Optimal Transport Plan (Optimal Cost: 35.7679).
g ^ ( 0 ) = 20 g ^ ( 1 ) = 10 g ^ ( 2 ) = 30 g ^ ( 3 ) = 40
f ^ ( 0 ) = 34.2724 20 0 0 14.2724
f ^ ( 1 ) = 23.2671 0 10 0 13.2671
f ^ ( 2 ) = 32.3767 0 0 30 2.3767
f ^ ( 3 ) = 10.0838 0 0 0 10.0838
Table 6. OT with Size (39,28).
Table 6. OT with Size (39,28).
Sample Optimal Cost Time Cost (s)
1 left 124.6884 81.7439
1 Right 42.0153 65.8820
2 left 97.4181 70.4414
2 Right 90.3658 66.4491
3 left 56.7008 54.8580
3 Right 69.9283 76.9399
4 left 89.5546 75.1159
4 Right 72.1899 67.7810
5 left 51.8627 74.7324
5 Right 59.4787 58.4266
6 left 72.9623 79.0964
6 Right 105.3368 88.5780
7 left 146.8131 76.0858
7 Right 57.5372 64.3336
8 left 110.2959 57.8042
8 Right 52.8154 73.2075
9 left 90.6085 71.9530
9 Right 59.2622 80.9185
10 left 76.7273 65.0734
10 Right 91.0504 79.3705
Table 7. OT with Size (19,14).
Table 7. OT with Size (19,14).
Sample Optimal Cost Time Cost (s)
1 left 61.8171 1.0307
1 Right 21.8712 0.9719
2 left 47.5094 1.0532
2 Right 46.5524 1.0328
3 left 29.6239 0.9313
3 Right 31.6513 1.0388
4 left 42.4647 1.0107
4 Right 32.1805 0.9507
5 left 24.3411 1.0018
5 Right 29.5494 0.9604
6 left 36.7987 0.9448
6 Right 53.9450 1.0180
7 left 72.1791 1.0598
7 Right 30.2502 0.9749
8 left 56.6340 0.9490
8 Right 27.3963 1.0443
9 left 43.7873 0.9613
9 Right 32.8113 1.0480
10 left 39.7919 0.9684
10 Right 44.2695 1.0034
Table 8. Optimal Transport for Entire Component with Size (19,38).
Table 8. Optimal Transport for Entire Component with Size (19,38).
Sample Time Consumption (s)
1 14.2441
2 13.8762
3 14.1679
4 14.6666
5 14.1432
6 14.0194
7 14.2059
8 14.1208
9 13.7494
10 13.9204
Table 9. Sensitivity in Optimal Transport with Size (19,14): Using the Transport from Sample 3 to the Standard As Example.
Table 9. Sensitivity in Optimal Transport with Size (19,14): Using the Transport from Sample 3 to the Standard As Example.
Pixel Changed Value Changed Cost Changed
(7,0) +1 -0.0059
+5 -0.0297
+10 -0.0585
+20 -0.1151
(3,13) +1 -0.0072
+5 -0.0357
+10 -0.0708
+20 -0.1136
(8,10) +1 +0.0048
+5 +0.0242
+10 +0.0486
+20 +0.1090
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

© 2024 MDPI (Basel, Switzerland) unless otherwise stated