# A Reinforcement Learning Algorithm for Automated Detection of Skin Lesions
## 3 Proposed Method
### Action Bundle and the Segmentation Executor  
The mask on which the neural network draws the brushstroke as the ROI renderer implements the segmentation executor mentioned above. There are two advantages of the segmentation executors. First, it could be well distinguished and combined with DDPG. Secondly, a neural network can have a fine-grained quality. The segmentation executor is run by using learning algorithms that are supervised and executes on a vast number of samples taken for training, which are collected from various graphical rendering systems. Several segmentation executors, including triangles, circles, square Bezier curves, and B-spline curves, produce multiple brushstroke forms. A polynomial B-spline curve is more reliable to employ than a Bezier curve since its degree is independent of the number of control points. The B-spline curve offers local control over each section of the curve through control points. For a given parameter, the total of the basis functions equals one. Based on the experimental findings, QBC and B-spline significantly benefit in the segmentation of lesion images. Thus, we use the QBC and B-spline to segment the lesion images. The QBC action parameters are described in Equation (4) as follows:  
\[A_{t}=(x_{0},y_{0},x_{1},y_{1},x_{2},y_{2},r_{0},r_{1}), \tag{4}\]  
where the three QBC control point coordinates are \((x_{0},y_{0},x_{1},y_{1},x_{2},y_{2})\), \((P_{0},P_{1},P_{2})\), \(A_{t}=(x_{0},y_{0},x_{1},y_{1},x_{2},y_{2},r_{0},r_{1})\). The thickness of the two QBC endpoints (\(P_{0},P_{2}\)) determines the parameters \((r_{0},r_{1})\). Approximately eight motion parameters were obtained using neural networks, with the stroke proportions and forms being generally distinct. The path traced by a quadratic Bezier curve is given in the form of function \(S(x)\) as seen in the Equation (5), given points \(P_{0},P_{1},\) and \(P_{2}\). The following Equation (5) below describes the QBC theorem, and the interpretation can be made by taking the linear interpolation of the points corresponding to the linear Bezier curves from \(P_{0}\) to \(P_{1}\) and then from \(P_{1}\) to \(P_{2}\) respectively. Then we rearrange the Equation (5) for obtaining \(S(x)\) in Equation (6) as follows:  
\[S(x)=(1-x)[(1-x)P_{0}+xP_{1}]+x[(1-x)P_{1}+xP_{2}],\ 0\ \leq\ t\ \leq 1 \tag{5}\]  
\[S(t)=(1-x)^{2}P_{0}+2(1-x)xP_{1}+x^{2}P_{2},\ 0\ \leq\ t\ \leq 1 \tag{6}\]  
The tangents at QBC \(P_{0}\) and \(P_{2}\) converge at \(P_{1}\). The curve starts at \(P_{0}\) in the direction of \(P_{1}\), where the curve ranges from 0 to 1 and curves from the direction of \(P_{1}\) to the end of \(P_{2}\). A spline of the order \(n\) is a piecewise polynomial function having a degree \(n-1\) present in a variable \(x\). The knots are those values of \(x\), where the intersection of the polynomial pieces occurs, and the listing is done in the ascending order as \(\{t_{0},t_{1},t_{2},\)....\(t_{n}\}\). When the distinct knots are considered, the first \(n-2\) derivatives of the polynomial components across each knot are continuous. Over a \(r\) knot, the spline is continuous only on the first \(n-r-1\) derivatives of the spline. In Equation (6), there is a single spline \(S_{i,n}(y)\) that obeys a given sequence of knots having a specific scaling factor satisfying Equation (7). \[S_{i,n}(y)=\left\{ \begin{array}{ll}0&\text{if }y<x_{i}\text{ or }y\ \geq\ x_{i+n}\\ non-zero&\text{otherwise}\end{array} \right. \tag{7}\]  
If the constraint is additionally added, such that \(\sum_{i}S_{i,n}(y)\)=1 for all y between the last and the first knot, then the factor of scaling \(\sum_{i}S_{i,n}(y)\) becomes fixed. The resulting spline functions are called B-splines. The defining of higher order B-splines in the form of a recursive Equation is shown in Equation (7) as follows:  
\[S_{i,k+1}(y)=w_{i,k}(y)B_{i,k}(y)+[1-w_{i+1,k}(y)]B_{i+1,k}(y) \tag{8}\]  
where \(w_{i,k}(y)=\left\{ \begin{array}{c}\frac{y-x_{i}}{y_{i+1}-x_{i}},\ x_{i+k}\
eq t _{i}\\ 0\ otherwise\end{array}