Present study is based on describing an ultrasound-assisted dispersive liquid–liquid microextraction coupled with derivative spectrophotometry (UAS-DLLME-UV–vis) as useful technique for selective determination of crystal violet (CV) and azure b (Az-B). The significant factors like pH, extractor volume, disperser value and extraction time contribution and their numerical coefficient in quadratic model were calculated according to central composite design (CCD). According to desirability function (DF) as good criterion the best experimental conditions was adjusted and selected at pH of 7.0, 170μL of chloroform, 800μL of ethanol that strongly mixed with the aqueous phase via 4min sonication. Additionally, under study system was modeled by trained artificial neural networks (ANNs) as fitness function with acceptable error of MSE 2.97×10−06 and 1.15×10−05 with R2: 0.9999 and 0.9997 for CV and Az-B, respectively. The optimum conditions by using genetic algorithm (GA) method was pH of 6.3, 160μL of chloroform, 740μL of ethanol and 4.5min sonication. Under above specified and optimize conditions, the predicted extraction percentage were 99.80 and 102.20% for CV and Az-B, respectively. The present UAS-DLLME-UV–vis procedure has minimum interference from other substances assign to the matrix, which candidate this method as good alternative to quantify under study dyes content with recoveries in the range of 86–100% for dyes. The detection limits were 2.043ngmL−1 and 1.72ngmL−1, and limits of quantitation were 6.81ngmL−1 and 5.727ngmL−1 for CV and Az-B, respectively. The proposed methodology was successfully applied for quantification of under study analytes at different media.