Recently, a new Pattern Recognition technique based on straight line segments (SLSs) was presented. The key issue in this new technique is to find a function based on distances between points and two sets of SLSs that minimizes a certain error or risk criterion. An algorithm for solving this optimization problem is called training algorithm. Although this technique seems to be very promising, the first presented training algorithm is based on a heuristic. In fact, the search for this best function is a hard nonlinear optimization problem. In this paper, we present a new and improved training algorithm for the SLS technique based on gradient descent optimization method. We have applied this new training algorithm to artificial and public data sets and their results confirm the improvement of this methodology.