V. Implementation of the System

An Efficient Shoe Placement System on Leather
Zin Mar Htun, Nang Aye Aye Htwe

Abstract— The significant proportion of the manufacturing
cost of a pair of shoes is invested in the neutral raw material and
so the efficient utilization of the resource is of prime importance.
Moreover, it is the most important parts for cutting process in
manufacture of leather shoes. This system present a genetic
algorithm based cutting strategy for optimizing the placement of
shoe components on leather. The image processing and genetic
algorithm theories are applied in this system. The images of
arbitrary shape leather and the base of the shoe were the input
of the system. The output of the system is the placement of the
bases of the shoe on the arbitrary shape leather. MATLAB
programming language is applied in this system.
are recombined (or crossed over) to create new, better,
offspring. Examples of GA operators are shown in figure 1.
Index Terms— Boundary Detection, Cutting process, Filling,
Genetic Algorithm, Morphological operation.
I. INTRODUCTION
Nowadays, in every domain computerized systems are
replacing the traditional human workforce. Among these
technologies placement of different sizes of shoes on leather
is also done by computerized system with the application of
different computing algorithms. Generally in shoe making the
cutting process, which is converting the natural resource of
tanned leather hides into the number of separate shapes
required for the manufacture of shoes, is undertaken manually
with part-placement on the skill of the operator. The system
investigates the use of a genetic algorithm for computer –
aided cutting of shoe components.
A genetic algorithm is a type of searching algorithm. It
searches a solution space for an optimal solution to a problem.
The key characteristic of the genetic algorithm is how the
searching is done. Genetic algorithms (GAs) are search
methods based on principles of natural selection and genetics
[3, 4, 5]. By using Genetic Algorithms the decision variables
of a search problem are encode into finite-length strings of
alphabets of certain cardinality. Chromosomes are the strings
which are candidate solutions to the search problem, the
alphabets are referred to as genes and the values of genes are
called alleles. GAs works with coding of parameters, rather
than the parameters themselves. Selection, recombination,
and mutation operators are basic operators in genetic
algorithms. Selection methods can be divided into fitness
proportionate selection and ordinal selection. Examples of
fitness proportionate selection methods are Standard
Roulette-Wheel Selection and Stochastic Universal Selection.
Tournament selection and truncation selection are ordinal
selection. After selection, individuals from the mating pool
Zin Mar Htun, Department of Information Technology, Mandalay
Technological University, (e-mail: [email protected]). Mandalay,
Myanmar,+959428127855, Nang Aye Aye Htwe, Department of
Information Technology, Mandalay Technological University, Mandalay,
Myanmar, (e-mail: [email protected])..
Fig. 1 Example of Genetic Algorithm Operators
In this paper, spatial coordinates of shoes are applied to GA
as chromosomes. Random coordinates of images are
produced and the parent chromosomes are selected by using
fitness function. Two rules are used when selecting fitness
function i.e. overlapping and overplacing. Next generation is
got by crossover of two parents. After mutation on the
obtained offspring, this mutation is replaced in the original
chromosome and calculates the fitness value. This process is
repeated till it reached the stopping criteria.
The remainder of the paper is organized as follows: Section
II briefly reviews the prior works on genetic algorithm. The
proposed system components are given in Section III. Section
IV briefly explains about materials and methods used on the
current system. The implementation results of the system are
described in Section V and Section VI concludes the research
work.
II. RELATED WORK
This section shows the related works that apply genetic
algorithm for different kinds of applications.
Henrik Esbensen presented a new genetic algorithm for cell
placement problem. The algorithm was based on a
generalization of the two-dimensional bin packing problem.
The genetic encoding of a macro cell placement and the
corresponding genetic operators were described. The
algorithm had been tested on MCNC benchmarks, and the
quality of the product placements was comparable to the best
1
published results. The limitation of this algorithm is that the
current runtime was too extensive [1].
E. Hopper and B. Turton described two genetic algorithms
for a rectangular packing problem. Both GAs were hybridised
with a heuristic placement algorithm, one of which was the
well-known Bottom-Left routine. A second placement
method had been developed which overcomes some of the
disadvantages of the Bottom-Left rule. The two hybrid
genetic algorithms were compared with heuristic placement
algorithms. In order to show the effectiveness of the design of
the two genetic algorithms, their performance was compared
to random search. Since the performance difference between
the two hybrids GAs was only due to the improved heuristic,
the decoder had a larger effect on the outcome of the hybrid
technique than the GA [2].
Glenn Whitwell developed and investigated new
approaches for two-dimensional stock cutting problems.
Three rectangle packing approaches and two irregular
packing approaches were developed and presented within
which have produced the best-known solutions for all of the
readily available benchmark data drawn from over twenty
years of cutting and packing. Further to this, initial benchmark
solutions were given for new problem instances that were
presented for both variants of the problem. Another major
contribution was the development of a no-fit polygon
generation algorithm that does not suffer from degenerate
cases that are found in other approaches from the literature.
Furthermore, the approach was then extended to handle
shapes which contain arcs. This was the first no-fit polygon
algorithm hat was able to deal with shapes consisting of arcs
as well as lines. The developed approaches are able to quickly
and accurately pack irregular shapes (lines, arcs and holes)
and have produced the best-known solutions on all of the
readily available datasets [6].
László Pál proposed a system that used Genetic Algorithm
for the two-dimensional Single Large Object Placement
Problem (SLOPP) problem. The two-dimensional Single
Large Object Placement Problem (SLOPP) problem
consisted of determining a cutting pattern of a set of n small
rectangular piece types (little object) on a rectangular stock
plate (large object) of length and width, as to maximize the
sum of the profits of the pieces to be cut. Each piece is
characterized by a length, a width, a profit (or weight) and an
upper demand value. Only guillotine cuts are allowed and the
pieces may be rotated by 90°. In this paper three heuristic
algorithms: WDH1, WDH2 and IFFH, were applied to
constrained two-dimensional cutting problems and the results
were compared [7].
Brian Aldershof and Olivia M. Carducci described a pair of
genetic algorithms for solving two stable matching problems.
A set of applicants for positions and a set of employers were
involved in both stable matching problems. Each applicant
and each employer prepared a rank order list of a subset of the
actors in the other set. The goal was to find an assignment of
applicants to employers in which if applicant a was not
assigned to employer b then either a prefers his assignment to
b or b prefers its assignment to a. In other words, no
applicant/employer pair can both improve their situations by
dropping their current assignments in favor of each other.
Their goal was to enumerate the stable matchings. An
interesting facet of these algorithms was the application of the
polyhedral characterization of stable matching problems to
their fitness function[8].
III. PROPOSED SYSTEM DESIGN
Firstly, image acquisition is carried out for leather and shoe.
The original input image to the system is colored jpeg image.
Both shoe and leather images are color images. Then these
color images are converted to gray images to remove RGB
values and get gray image which contains only black and
white with two binary values. After converting to gray image,
binarization is done to remove unwanted gray values which
are used only for knowing whether there is pixel value or not.
After that boundary detection is used for selecting the
boundary values of shoes. Filling is done with random
method. Filling is used to know the area of the image. Finally
genetic algorithm is used for shoe placement. The phases used
in the system are shown in Figure 2.
Start
The Image acquisition of Leather and
Shoe
Gray Image Transformation
Binarization
Boundary Detection
Filling
Genetic Algorithm
Placement of shoe components on
leather
End
Fig. 2 System flow diagram for Placement of shoe
components on leather
IV. MATERIALS AND METHODS
Different methods of image processing are used in this
system. These methods are Color to Gray Conversion, Global
Thresholding Method, Inner Border Detection and Genetic
Algorithm.
A. Color to Gray Conversion
The most trivial way to convert a color image to grayscale is
to retain and use the luminance component of the color image.
An alternative is to compute the colors in the graphic and to
2
assign different levels of gray to all neighboring colors. For
converting the RGB image to gray image the transform
equation is used:
Gray = (0.299*Red+0.5876*Green+0.114*Blue)
For example, for an RGB image with the pixel values RGB
of 253, 220 and 185 respectively, can be converted into gray
image of pixel value of 226 by using this equation. This is
shown in figure 3.
(b) Threshold image using threshold value T= 250
(a) Original image
(b) Gray image
Fig. 3 Conversion of RGB image into gray image
B. Global Thresholding Method
Thresholding is used to obtain the binary value of image.
Global thresholding method is used to determine threshold T
from the whole image f by the function T(f). In this system,
global thresholding is used for binarization after conversion
of color to gray image. Thresholding can reduce the storage
space as well as provide high processing speed. Binary image
g can be got as follows:
g(i,j) = 1 for f (i,j) > = T
g(i,j) = 0 for f (i,j) < T
Where T is the thresholding, g(i,j)=1 for image elements of
objects, and g(i,j)=0 for image elements of background. In
global thresholding, a single threshold for all the image pixels
is used. A global threshold is determined from the whole
image f:
T = T (f)
In this system, the threshold point is set to 250 depending
on the gray leather. The values lower than these thresholds are
not suitable for achieving the good image. Thresholding
example is shown in Figure 4.
(a) Gray image
(c) Threshold image using threshold value T= 210
Fig. 4 Thresholding with different threshold values
C. Inner and Outer Border Detection
The shoe is needed to place onto the leather. And placement
can be done only when the boundary of shoe and leather is
exactly known. Therefore, boundary detection is very
important in placement. Boundary detection is also called
edge detection because edges typically occur on the boundary
between two different regions in an image. It can be used to
produce line drawing of a scene from an image of that scene.
Boundary detection can be divided into two methods: Inner
boundary detection and Outer boundary detection. Inner
boundary detection may need to trace outermost pixels of
foreground. Outer boundary detection may need to trace
innermost pixels of background. Among these two methods
the proposed system uses inner boundary detection.
D. Genetic Algorithm
A genetic algorithm is a type of searching algorithm. It
searches a solution space for an optimal solution to a problem.
The major phases of Genetic Algorithms are:
• Create an initial population of chromosomes
• Evaluate each of the chromosomes in the initial
population
• Select chromosomes that will have their information
passed onto the next generation
• Crossover the selected chromosomes to produce
new offspring chromosomes
• Mutate the genes of the offspring chromosomes
• Repeat step three through five until a new population
of chromosomes has been created
3
•
Evaluate each of the chromosomes in the new
population
• Repeat step three through seven until some
termination condition has been meet
Operators used in Genetic Algorithm are selection, crossover
and mutation. The selection process is analogous to the
survival of the fittest in the natural world. Individuals are
selected for crossover based upon their fitness values the fitter
the individual; the more likely that individual will be able to
reproduce. Crossover is the main genetic operator. It operates
on two parent individuals and generates an offspring. The
crossover combines schemata from both parents, and
therefore the offspring inherits some of the characteristics of
the parents. The simplest form of crossover consists of
choosing a random cut point in the gene strings of the parents
and generating the offspring by combining the segment of one
parent to the left of the cut point with the segment of the other
parent to the right of the cut. Mutation is the primary
variation/search operator. Mutation is often the secondary
operator in GAs, performed after crossover by randomly
choosing a chromosome in the new generation to mutate. One
of the most common mutations is the bit-flip mutation. In
bitwise mutation, each bit in a binary string is changed (a 0 is
converted to 1, and vice versa) with a certain probability,
known as the mutation probability. Once the new offspring
solutions are created using crossover and mutation, they need
to be introduced into the parental population. It is done by
replacement. The parent chromosomes have already been
selected according to their fitness, so the children are among
the fittest in the population and so the population will
gradually, on average, increase its fitness. Some of the most
common replacement techniques are Delete-all, Steady-state
and Steady-state-no-duplicates. Figure 5 shows the flowchart
of GA.
V. IMPLEMENTATION OF THE SYSTEM
This system is placement of shoes using GA implemented
using MATLAB. The system includes three main parts: image
enhancement, initialization and shoe placement using GA.
Firstly, image of leather and shoe are loaded as the input of
the system and this is shown in Fig.7. Image enhancement is
used as the prior step to initialization. There are two parts in
image enhancement: boundary detection and filling. Filling is
done to know the area of the image. Initialization is done after
image enhancement. And finally genetic algorithm is used to
place the shoe components on the leather. Figure 6 shows the
main menu of propose system.
Fig. 6 Main Menu of Propose System
Figure 7 shows the user interface to select leather and shoe for
the system.
Population Initialization
Population Evaluation
Stopping
Criterion
Satisfied?
Yes
Output Best Solution
No
Selection
Fig. 7 Selected Load Images
The images of shoe and leather which is already stored
are loaded as input to the system for image enhancement
which is boundary detection and filling. This is shown in
figure 8.
Crossover
Mutation
Population Evaluation and Updating
Fig. 5 Flowchart of Genetic Algorithm
The first input to the GA is in the form of bit string and
these bit strings are initial population for the genetic
algorithm. Then, these initial populations are evaluated for
selection till the best individuals are obtained.
Fig. 8 Load Leather and Shoe Images
4
Boundary detection is shown in Figure 9. Boundary
detection is used to know the boundary of leather and shoe.
producing generation. Final output result for shoe placement
is shown in Figure 12.
Fig. 9 Boundary detection
Fig. 12 Placement of shoes using Genetic Algorithm
Filling is used to count the pixel values of leather and shoe
and to know that whether these values are within the boundary
or not while computing the fitness of GA so that the shoes are
overlapping or not can be known. This is shown in Figure 10.
Fig. 10 Filling
The decimal values of the coordinates are converted to
binary value to produce chromosomes. In this case, the
coordinates of shoes are placed to getrid of beyond the
boundary. Initialization result is shown in Figure 11.
VI. CONCLUSION
The proposed system can be used for the placement of shoe
on the arbitrary shape leather. The use of thresholding reduces
the storage space, gets high speed and removes unnecessary
detail from an image to concentrate on essential. In this
system, placement is done with the use of GA based
computerized system. . GA can quickly scan a vast solution
set and solve problems with multiple solutions so very useful.
GA is a method which is very easy to understand and it
practically does not demand the knowledge of mathematics.
The inductive nature of the GA means that it does not have to
know any rules of the problem - it works by its own internal
rules. So, human labor cost can be reduced effectively. As the
chromosome cannot be reduced or increased, the space
between one shoe and another cannot be calculated. All the
number of shoes calculated on leather cannot be placed in
reality because the shoes are placed by counting the pixel
values. For future works, GA can be utilized by combining
with other decision making techniques such as neural
network, fuzzy logic and hidden Markov model.
ACKNOWLEDGMENT
Fig. 11 Initialization
In genetic algorithm, 4 chromosomes are used to perform
four placements of shoes on the leather. In each chromosome,
the coordinates of shoes are composed randomly in
initialization process of GA. The best placement of shoes on
leather is achieved after using genetic algorithm with repeated
First of all, the author is grateful to her parents who
specially offered strong moral and physical support, care and
kindness. The author is deeply thankful to Dr. Nang Aye Aye
Htwe, Mandalay Technological University, for her overall
supporting during the writing of this paper. The author would
like to express her sincere thanks to Dr. Aung Myint Aye,
Associate Professor and Head, Department of Information
Technology, Mandalay Technological University, for his
invaluable guidance and suggestion for this research work.
The author would like to thank greatly to all teachers and
friends who contributed to their continuous encouragement
and instructions.
REFERENCES
[1]
[2]
Henrik Esbensen “A Genetic Algorithm for Macro Cell Placement”,
1992
E. Hopper, B. Turton “A Genetic Algorithm for a 2D Industrial
Packing Problem”, 1999
5
[3]
[4]
[5]
[6]
[7]
[8]
Goldberg, D. E., 1989b, Genetic Algorithms in Search Optimization
and Machine Learning, Addison-Wesley, Reading, MA.
Bremermann, H. J., 1958, The evolution of intelligence. The nervous
system as a model of its environment, Technical Report No. 1,
Department of Mathematics, University of Washington, Seattle, WA.
Fraser, A. S., 1957, Simulation of genetic systems by automatic digital
computers. II: Effects of linkage on rates under selection, Austral. J.
Biol. Sci 10:492–499.
Glenn Whitwell, “Novel Heuristic and Metaheuristic Approaches to
Cutting and Packing”, September 2004
László Pál , “A Genetic Algorithm for the Two-dimensional Single
Large Object Placement Problem”, 2007
Brian Aldershof and Olivia M. Carducci, “Stable Marriage and
Genetic Algorithms: A Fertile Union”, 1999
6