The invention relates to the technical field of
artificial intelligence and
software engineering, and discloses a
small sample individual fairness testing method based on
a domain adaptive flow model. Aiming at the problems of difficulty in obtaining target model
training set data, low discrimination sample generation efficiency, insufficient sensitive attribute decoupling and the like in the existing
black box fairness test, the invention provides the following technical scheme: firstly, constructing a gating residual domain adaptive flow model, and performing dynamic fusion on a frozen source domain projection matrix and a trainable low-rank adapter to obtain an adaptive flow model;
domain adaptation of the flow model is realized under the condition of not depending on a target model
training set; secondly, a two-stage anti-fact generation strategy is adopted, a
seed sample set is constructed by utilizing a dynamic
radius attenuation mechanism, and discriminated samples are efficiently expanded in combination with triple disturbance; finally, gradient orthogonal constraint is applied to the hidden space of the flow model, and decoupling control over the sensitive attributes and the semantic features is achieved. The
black box fairness testing method can be used for
black box fairness testing of classification models such as tables, texts and images, and has good practical significance and actual effect.