# Local Ternary Cross Structure Pattern: A Color LBP Feature Extraction with Applications in CBIR
## 3 Feature Extraction
### Local Ternary Cross Structure Pattern  
According to the anatomical structure of the human visual system, a novel local ternary cross structure pattern (LTCSP) is proposed to integrate the color information into the LBP information as a whole. For an original map \(M(i,j)\), the reference point is flagged as \(M(i_{0},j_{0})\) and the eight nearest points are flagged as \(M(i_{p},j_{p})\), where \(p\in\{1,2,\ldots,8\}\). Firstly, the LBP feature map is computed as \(LBP(i,j)\) in Section 2.1, and the color quantization map is computed as \(CQM(i,j)\) in Section 3.1. Secondly, with the help of a thresholded polynomial selectivity indicator sign (\(\cdot\)), the color quantization map and the LBP feature map are encoded into the color ternary map and the LBP ternary map respectively. Mathematically, the thresholded polynomial selectivity indicator sign (\(\cdot\)) is defined as follows:  
\[\text{sign}(\text{Y}(i_{0},j_{0}),\text{Y}(i_{p},j_{p}))=\left\{ \begin{array}[] {ll}1&\text{if }\text{Y}(i_{0},j_{0})>\text{Y}(i_{p},j_{p})\\ 0&\text{if }\text{Y}(i_{0},j_{0})=\text{Y}(i_{p},j_{p})\\ -1&\text{if }\text{Y}(i_{0},j_{0})<\text{Y}(i_{p},j_{p})\end{array} \right., \tag{5}\]  
where \(p\in\{1,2,\ldots,8\}\), and \(\text{Y}(i,j)\) represents a feature map. For the LBP feature map, \(\text{Y}(i,j)\) is considered as \(LBP(i,j)\); for the color quantization map, \(\text{Y}(i,j)\) is considered as \(CQM(i,j)\). Thirdly, motivated by the optic chiasm, in which a part of the visual cues between the left and right cerebral hemispheres are exchanged, the eight nearest points in the color and LBP ternary maps are correspondingly crossed to extract the color and LBP cross maps. Fourthly, with the help of a counter \(\delta\{\cdot\}\) that computes the occurring numbers of ternary in the eight nearest points of the color and LBP cross maps, the maximum numbers are retained to construct the color and LBP structure maps respectively. Inspired by the max-pooling strategy, when there exist two maximum occurring numbers, the structure with the larger value is retained. Finally, the retained points in the color and LBP structure maps are computed as the feature vectors, and the values of the reference points are correspondingly calculated as the indices of the feature vectors. Mathematically, we define the LTCSP as follows:  
\[LTCSP_{LBP}(LBP(i_{0},j_{0}))=\max_{p\in\{1,2,\ldots,8\}}\beta\Big{\{}\text{ sign}(CQM(i_{0},j_{0}),CQM(i_{p},j_{p}))\Big{\}}, \tag{6}\]  
\[LTCSP_{CQM}(CQM(i_{0},j_{0}))=\max_{p\in\{1,2,\ldots,8\}}\beta\Big{\{}\text{ sign}(LBP(i_{0},j_{0}),LBP(i_{p},j_{p}))\Big{\}}, \tag{7}\]  
For clarity, the schematic diagram of the LTCSP is illustrated in Figure 4, where the LTCSP is computed as \([LTCSP_{CQM}(250)=6,\)\(LTCSP_{LBP}(235)=4]\). Experimentally, the feature dimensionality of \(LTCSP_{CQM}\) and \(LTCSP_{LBP}\) are \(3\times 2(A_{\text{a}^{*}}+1)\times 2(A_{\text{b}^{*}}+1)\) and \(256\) respectively. Figure 4: Schematic diagram of the local ternary cross structure pattern (LTCSP). In order to select the optimal color quantization levels (\(A_{\text{a}^{*}}\), \(A_{\text{b}^{*}}\)), we need to compare the average precision rates (APR) of 25 possible combinations according to different image datasets in the offline stage. Mathematically, given an image dataset \(D\), the maximization APR is defined as follows:  
\[\underset{A_{\text{a}^{*}},A_{\text{b}^{*}}}{\text{argmax}}\text{APR}(D|A_{a^{* }},A_{\text{b}^{*}}), \tag{8}\]  
where APR(\(D|A_{\text{a}^{*}}\), \(A_{\text{b}^{*}}\)) represents the APR score, where \(A_{\text{a}^{*}}\in\{1,\,2,\,\ldots,\,5\}\) and \(A_{\text{b}^{*}}\in\{1,\,2,\,\ldots,\,5\}\). In Section 5.4, we provide the optimal color quantization levels (\(A_{\text{a}^{*}}\), \(A_{\text{b}^{*}}\)). Moreover, in order to reduce the computational cost, the _LBP_ feature map \(LBP(i,j)\) in \(LTCSP\) can be replaced by the \(LBP_{uni}\) feature map \(LBP_{uni}(i,j)\) to construct the uniform local ternary cross structure pattern (\(LTCSP_{uni}\)).