AW Dev Rethought

βœ‚οΈ Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away - Antoine de Saint-ExupΓ©ry

πŸ” AI/ML Security with Python β€” Model Inversion 🐍


Description:

A print shop keeps the finish on an order private. Its tracker shows the page count, number of copies and estimated pickup time. For a 24-page job with two copies, a customer sees 25 minutes. What would they need to know for that number to reveal the finish?


Two orders, one difference

We fit a local linear regression to 24 fictional jobs. The synthetic timings add four minutes for a coated finish. We then hold pages and copies fixed and ask the fitted model for each finish’s estimate. All audit jobs have two copies, a copy count held out of training.

Job, two copies each Plain estimate Coated estimate What the customer sees with ten-minute windows
24 pages 21 min 25 min Both show 20–29 min
36 pages 27 min 31 min 20–29 min or 30–39 min

For the first order, someone who knows the two possible finishes and their expected replies can identify coated from the 25-minute estimate. Without that mapping, the number alone has no label attached. This illustrates attribute disclosure, one form of model inversion risk. Original model inversion study


Change the response customers receive

Suppose customers only need a pickup window. Round each model prediction to the nearest whole minute, then group those integers into bands.

def time_band(minutes):
    lower = (minutes // 10) * 10
    return f"{lower}–{lower + 9} min"

At 24 pages, both finishes now produce the same public reply. At 36 pages, 27 and 31 straddle the boundary at 30. The four-minute effect is identical in both examples. Its position relative to the cutoff determines what survives in the display.


Measure what stays visible

The notebook tests every even page count from 18 through 40, making one plain job and one coated job per count.

Public response Pairs with different replies Pairs with identical replies
Whole-minute estimate 12 of 12 0 of 12
Ten-minute window 6 of 12 6 of 12

Six of twelve measures separation on these chosen pairs. It tells us how often this display preserves a distinction. Real identification accuracy would also depend on which jobs occur, what an observer knows and how variable the estimates are.

Try it in the notebook. Pick a five-minute window and predict which page counts will still share a reply. Then run the comparison. When choosing a release format, test the jobs on either side of its cutoffs as well as the jobs in the middle.


Link copied!

Comments

Add Your Comment

Comment Added!