## 1 Introduction  
Rice (_Oryza sativa L_.) is a vital cereal food in Asia and is consumed by almost half of the world's population [1]. The chemical composition of rice is characterized by a high content of carbohydrates, mainly starch (56-74%), a moderate content of protein (8-11%), and a minor content of lipids (2-4%) and minerals (1-3%) [2]. There are many different kinds of rice, including white rice, which is widely consumed, and pigmented rice. Pigmented rice, such as purple and black rice, contains important bioactive compounds beneficial for human health. The bran of black rice is rich in fiber and many kinds of phytochemicals, such as tocopherols, tocotrienols, oryzanols, vitamin B complex, and other phenolic compounds [3; 4]. The protein content of black rice was also reported to be higher than white rice. In addition, black rice contains anthocyanins and proanthocyanidin in its aleurone layer, meaning that black rice is considered an essential health product. Anthocyanins are a water-soluble flavonoid compound that is responsible for the appearance of certain colors in nature and may appear as red, purple, or blue, depending on the pH. This color change is due to the reversible structural transformation of anthocyanins in a certain range of pH values [5; 6]. Anthocyanins were reported to be an essential component of traditional herbal medicine [7], and have a wide range of pharmacological applications against various stress conditions and chronic diseases, e.g., inflammation, cognitive decline, neural dysfunction, capillary fragility and permeability, platelet aggregation, cardiovascular complication, liver damage, lipid peroxidation, and cancer tumor growth [8]. Moreover, in vivo tests reported that supplementation of black rice containing anthocyanins in the diet reduces atherosclerotic lesions in hypercholesterolemia rabbits and apolipoprotein-E-deficient mice. These biological activities were related to anthocyanins' potencies as antiradical scavenging and antioxidant activities [9]. The anthocyanins content in black rice is greatly affected by genotype and the environmental growth condition [10] and reported ranging from 0.52 to 3.47 mg/g. Cyanidin-3-glucoside (C3G) and peonidin-3-glucoside (Pn3G) are the most common forms of anthocyanins found in black rice [11]. Other forms of anthocyanins observed in black rice are cyanidin-3,5-diglucoside, cyanidin-3-rutinoside, cyanidin-3-gentiobioside, malvidin-3-glucose, and peonidin-3-rutinoside [12; 13]. Anthocyanins are distributed in all parts of black rice seeds but are mostly accumulated in the bran. The anthocyanins level in bran is more than fifteen times higher than that in the embryo. Furthermore, the C3G and Pn3G content in bran were reported as being 98% and 93% of their total content in whole black rice, whereas only 2% and 7% were available in embryos, respectively [14; 15; 16]. Chromotography techniques, including paper chromatography and high-performance liquid chromatography (HPLC), have extensively studied the qualitative and quantitative chemical components, including anthocyanins, in agricultural products [17]. These techniques are a destructive method in sample preparation and require chemicals solvent for the pre-analysis of extraction, which is time-consuming, costly, and labor-intensive. In addition, these methods also generate chemical waste, which is harmful to the environment. Moreover, the large-scale detection of anthocyanins attributed to a single seed is quite difficult with these techniques. Thus, chemical-based seed selection for the quality control in factories remains a challenging process. Hence, the development of non-destructive methods related to spectroscopy and image processing analysis allows for overcoming the drawbacks mentioned above. Near-infrared and mid-infrared spectroscopy methods have been widely used to detect anthocyanins in agricultural products such as soybeans [18], flowering tea [19], and sweet cherries [20].