This paper presents two devices to detect the liquid dielectric characterization. The differential method was used to enhance the robustness and reduce tolerance. A basic sensor based on defected ground structure (DGS) was designed and the optimization for the squares of the DGS via adaptive genetic algorithm was applied to enhance the performance of the microwave sensor, which was shown by the difference of the two resonant frequencies. Furthermore, the electric field distribution was enhanced. Glass microcapillary tubes were used to hold samples to provide an environment of non-invasive. The optimized device exhibited the sensitivity of 0.076, which is more than 1.52 times than the basic structure. It could be considered a sensitive and robust sensor with quick response time for liquid dielectric characterization.