Sie sind auf Seite 1von 4

Discrete Tomographic Reconstruction of Binary Matrices Using Tabu Search and Classic Ryser Algorithm

Pth Mikls*
*Subotica

Tech, Department of Informatics, Subotica, Serbia, email: pmiki@vts.su.ac.rs

Abstract Discrete tomography is concerned with reconstructing images from projections. In this paper the binary image is reconstructed from only two projections. A new reconstruction method of binary images is shown that is based on tabu search and the classic Ryser algorithm. The binary image is first reconstructed with the classic Ryser algorithm, and after that smart switching and constraint satisfaction is used to reconstruct a desired matrix. Keywords: Discrete tomography, image reconstruction, tabu search.

(a)

(b)

(c)

I. INTRODUCTION In discrete tomography the concern is on the reconstruction of matrices from few (in our case two) projections. Horizontal and vertical projections of the binary matrix are taken that is shown in Fig. 1.

(d) (e) Figure 2. Steps in reconstructing the binary matrix with the classic Ryser algorithm. (a) The original binary matrix, (b) Switched columns in non increasing order, (c) Filled matrix, (d) The matrix after the elements were shifted, (e) The matrix after the columns were switched back.

1. 2.
Figure 1. Example of a binary matrix to be reconstructed from two projections.

3.

In this case, the projections are


R = [3 4 4 3 1]

C = [1 4 4 5 1]

(1) (2)

4.

Arrange the elements of C in non increasing order (Fig 2b.). Fill the rows with ones (1) from left to right according to vector R (Fig 2c.). Go through the matrix from up to down and from right to left and move the ones to the right until the number of ones differs from elements of C (Fig 2d.). Switch back the columns (Fig. 2e.). III. TABU SEARCH

where R represents the row sum vector, and C represent the column sum vector. If a solution exists, the binary matrix can be reconstructed based on these two vectors. The conditions for existence and uniqueness were studied by Ryser [3]. The trivial condition for the existence of the result is that the sum of entries in R and C are equal. II. CLASSIC RYSER ALGORITHM

This algorithm will be presented on a simple example. Suppose that a hv-convex binary matrix shown is Fig. 2a is to be reconstructed. The horizontal and vertical projections are and R = [2 4 3 3 2] . When reconstructing with the classic C = [1 2 5 4 2] Ryser algorithm the following steps must be done:

Tabu search is a mathematical optimization method, belonging to the class of trajectory based techniques. Tabu search enhances the performance of a local search method by using memory structures. Tabu search is a metaheuristic algorithm that can be used for solving combinatorial optimization problems, such as the traveling salesman problem. Tabu search uses a local or neighborhood search procedure to iteratively move from a solution x to solution x in the neighborhood of x, until some stopping criterion has been satisfied. To explore regions of the search space that would be left unexplored by the local search procedure, tabu search modifies the neighborhood structure of each solution as the search progresses. The solutions admitted to the new neighborhood are determined through the use of memory

structures. The search then progresses by iteratively moving from a solution x to a solution x in the new neighborhood. The most important type of memory structure used to determine the solutions is the tabu list. In its simplest form, a tabu list is a short term memory which contains the solutions that have been visited in the recent past (less than n iterations ago, where n is the number of previous solutions to be stored). Tabu search excludes solutions in the tabu list from the new neighborhood. However, there are cases where the next potential solution can be on the tabu list. If the quality of the potential solution that is on the tabu list is better than IV. HV-CONVEX MATRICES In this paper concern is on the reconstruction of hvconvex matrices. In such matrices the series of 1s is not broken in any of the rows or columns [1,3,4]. This additional constraint considerably reduces the number of possible solutions because no switching elements can occur in the entire matrix. Examples for matrix convexity are given in Fig. 3. In this paper not only one connected component matrices will be reconstructed, but matrices also with more connected components. Such matrices are shown on Figure 4. Matrices with more connected components also could be hv-convex.

Figure 5. Reconstruction of the binary matrix with Rysers algorithm.

Figure 6. Smart switching the elements to reconstruct a hv-convex matrix.

a)

b)

c)

Figure 3. a) hv-convex matrix, b) h-convex matrix, c) v-convex matrix.

The majority of this paper tries to find an effective way of smart switching in order to reconstruct a hv-convex matrix. There is no unique solution to this problem, and it is very difficult to determine the minimum number of switching steps to achieve this goal. Fig. 6 shows two steps how to reconstruct a hv-convex matrix. One heuristic algorithm will certainly not find a solution in these two steps. In every position of the matrix that was reconstructed by Rysers algorithm all possible switching steps are found, and the quality of every following step is analyzed through two criteria: 1. the number of 4-connected components in the binary image, 2. number of streaks of ones for every row and every column. An example of determining the quality of the following step is presented on Fig. 7.

(a) (b) (c) Figure 4. (a) Three component hv-convex matrix, (b) Two component hv-convex matrix, (c) Two component not hv-convex matrix.

(a) (b) (c) Figure 7. Three possibilities of switching one step of the matrix from Fig. 5.

V.

EXPLANATION OF THE METHOD

In this new method the reconstruction of the matrix is carried out in two steps. The first step the reconstruction of the binary matrix with the Ryser algorithm. In this step no attention is paid on the hv-convex constraint. After this step every row and every column of the matrix has the desired number of ones. In the final step of the algorithm smart switching is used to recover a hv-convex structure of the matrix from its projections. These two general steps are presented in Figure 5 and Figure 6 respectively.

The quality of step from Fig. 7a. is determined by the following calculation. Difference between the real and desired number of 4-connected components is 3 (4 instead of 1). Difference between the real number of streaks of ones and the desired number of streaks for each row is 0+2+1+0+0=3. Similarly for the columns: 0+0+0+0+1=1. Both of these quantities are squared and the square root is found: 32 + 12 = 10 = 3.16 . These two values are summed together to give the quality of the step: 3 + 3.16 = 6.16 . Similarly we can find the quality of possible steps from Fig. 7b and Fig. 7c. Those values are respectively 3.23 and 2. As it can be seen the last value is the smallest, so if only those three possible steps were

available, the next step would be the matrix position from Fig. 7c. After moving to position from Fig. 7c, the previous matrix is put on the tabu list. This means that in the next step the algorithm can not move back to the previous position. Matrices on the tabu list represent forbidden states for the algorithm. The tabu list works as a FIFO memory. After every step one more entry is added to the tabu list until the tabu list becomes full. After that the previous steps keep entering the tabu list, but the bottom entries drops out from the list, and those states become available again. The tabu list represents a way of avoiding recent matrix states. The presented method of determining the quality of each step is not the only one, other more complicated formulas might give better results. But this quite simple method gives satisfactory results for the most matrices. The time needed to find a solution depends on the matrix to be reconstructed itself, and the length of the tabu list. If the tabu list is too short, repeated states could appear quite often, and a solution will never be found. On the other hand, a too long tabu list could take us quite far from the solution. In our experiments the length of the tabu list was limited to 100, in special cases it was increased to 250. The effect of too short tabu list on the solution can be seen on Fig. 8 where the quality of the solution is plotted against the number of steps. The current solution quality has a period of 150 steps which means that the correct solution will never be found. This drawback can be overcome by choosing a longer tabu list.

If a bigger influence of one of the parameters is needed on following step, the parameters can be weighted with appropriate coefficients, so equation (3) becomes

q = a p1 + b p2

(4)

As it can be seen from the experimental results, parameters a and b can have a significant impact on the number of switching steps before the solution is found. Experiments were carried out for three cases: 1) a=1, b=1; 2) a=1, b=10; and 3) a=10, b=1, and the results are summarized in Tables I, II and III. Based on parameters a and b some general conclusions can be made, but it is not quite clear how parameters a and b influence the number of switching steps.
TABLE I. NEEDED NUMBER OF STEPS/SWITCHES FOR MATRIX SIZE 10X10

a = 1, b = 1
15%
MIN

20% 1 161 76 25 34 28 -

30% 2 940 46 6 288 75 -

40% 53 77 62 -

50% 9 130 49 -

75% 1 6 4 -

13 25 18

1
COMP.

MAX AVG MIN

2
COMP.

MAX AVG MIN

3
COMP.

MAX AVG MIN

4
COMP.

MAX AVG MIN

5
COMP.

MAX AVG

TABLE II. NEEDED NUMBER OF STEPS/SWITCHES FOR MATRIX SIZE 10X10

a = 10, b = 1
Figure 8. Periodic intervals in solution quality because of too short tabu list. 1
COMP.

15%
MIN MAX AVG MIN

20% 1 165 57 25 202 54 -

30% 2 124 26 6 239 132 -

40% 53 375 174 -

50% 9 129 34 -

75% 1 6 3 -

14 31 20

VI.

EXPERIMENTAL RESULTS
2
COMP.

In the experimental phase several matrices were tested. Different classes of matrices were tested based on their size, percentage of ones they contain and the number of connected components. During execution, the quality of each state was evaluated through parameters p1 and p2. Parameter p1 is the difference between the real and the desired number of connected components, and parameter p2 is the sum of differences between the real and desired number of streaks of ones for each row and column. The quality of each following step is calculated as the sum of these two parameters
q = p1 + p2

MAX AVG MIN

3
COMP.

MAX AVG MIN

4
COMP.

MAX AVG MIN

(3)

5
COMP.

MAX AVG

TABLE III. NEEDED NUMBER OF STEPS/SWITCHES FOR MATRIX SIZE 10X10

a = 1, b = 10

a=1, b=10
MIN

15% 9 16 12

20% 1 226 53 15 80 58 -

30% 2 146 34 6 51 24 -

40% 6 15 12 -

50% 16 130 40 -

75% 1 6 3 Figure 11. Scans from a number of directions provide information about the density distribution inside the object.

1
COMP .

MAX AVG MIN

2
COMP .

MAX AVG MIN

3
COMP .

MAX AVG MIN

VIII. CONCLUSIONS In this paper a new method is shown for reconstructing hv-convex binary matrices from its orthogonal projections. Tabu search is introduced for discrete tomography problems. The role of parameters a and b are analyzed on the number of switching steps before a solution is found. Results showed that this method performs as good as any other known reconstruction technique. REFERENCES
[1] Marek Chrobak, Christoph Drr: Reconstructing hv-convex Polyominoes from Orthogonal Projections, Information Processing Letters, March 1999, Volume 69 Issue 6. Richard Brualdi: Algorithms for constructing (0,1)-matrices with prescribwd row and column sum vectors, Discrete Mathematics, Volume 306, Issue 23, pp. 2989. H.J. Ryser: Matrices of zeros and ones, Bull. Amer. Math. Soc. Volume 66, Number 6 (1960), pp. 442-464. H. J. Ryser: Combinatorial properties of matrices of zeros and ones, Canad. J. Math. vol. 9 (1957) pp. 371-377. Maciej Gebala: The Reconstruction of Convex Polyominoes from Horizontal and Verical Projections, Lecture Notes In Computer Science; Vol. 1521, 1998, pp. 350-359. Alberto Del Lungo: Reconstructing permutation matrices from diagonal sums, Theor. Comput. Sci. 281(1-2),2002, pp. 235-249. Pth Mikls, Lendk Imre: Branch and Bound Discrete Tomography Reconstruction of Binary Contours, 8th International Symposium on Intelligent Systems and Informatics (SISY 2010), pp. 87-91.

4
COMP .

MAX AVG MIN

5
COMP .

MAX AVG

During the experimental phase, it was verified that our new method using tabu search finds a solution, or at least one of the solutions in case the solution is not unique. With minor changes it is possible to modify the algorithm to reconstruct not only hv-convex matrices but binary matrices that satisfy other constraint. One of the future ideas of the author is the reconstruction of binary contours whose inner territory is hv-convex. In that case an additional parameter p3 must be added whose task would be to count the pixels with exactly two 4neighbours. VII. POSSIBLE APPLICATIONS An example of such a reconstruction problem can be found in medical CAT-scanners: Groups of parallel Xrays are sent through the body in a number of directions, providing information about density distribution inside the body. From these partial data, an image must be reconstructed which approximates the true cross-section as good as possible [1, 5]. Such an orthogonal projection is shown on Fig. 11.

[2]

[3] [4] [5]

[6] [7]