Interoperable Ballot Style Validation

12 views
Skip to first unread message

John Dziurlaj

unread,
Aug 30, 2022, 9:26:17 AM8/30/22
to cdf-ball...@list.nist.gov

Good Morning!

 

I am sharing the interoperable ballot style validation tooling that was demonstrated during the last research group meeting call. This tooling creates overlays that can be applied atop a ballot proof PDF to visually verify that the ballot definition properly represents the ballots produced by a voting system EMS.

 

I look forward to your feedback.

 

Regards,

 

John Dziurłaj /d͡ʑurwaj/

Sr. Solutions Architect, The Turnout

 

Carl Hage

unread,
Sep 18, 2022, 10:59:04 PM9/18/22
to cdf-ball...@list.nist.gov
On 8/30/22 6:26 AM, 'John Dziurlaj' via cdf-ballot-styles wrote:
> I am sharing the interoperable ballot style validation tooling
> <https://github.com/usnistgov/BallotDefinition/blob/examples/examples/interoperable_ballot_styles.md#interoperable-ballot-style-validator>
...
> I look forward to your feedback.

Thanks for posting that John! It's good to include examples of
validation. I finally had a chance to take a look at it.

This demo illustrates using an overlay, I presume for manual checking.
Other than manual checking of option rectangles and some text, the demo
can't validate the association between OptionPosition and ContestOption
or Contest extent.

I think a better validator would be an automated tool that can verify
the text found within declared contest areas. Here are some ideas on how
that might work...

Various open source PDF converters exist-- one could be used to extract
text with locations, and graphics with locations and shapes. We presume
the converter can build text phrases in a line of text within a column,
and we can associate font info (if needed) with the text. When there are
superscripts (e.g. footnote reference), there could be issues.

Most of the graphics in the examples are straightforward- a rectangle or
oval for option position. Example 2 has the most complex graphics--
solid rectangles for the "timing marks" and shaded backgrounds. The
borders are horizontal or vertical lines. The ovals are formed of
connected arcs in a set of strokes. A relatively simple algorithm could
identify the bordered rectangular areas and a rectangular or circle/oval
for an OptionPosition or solid fiducial. (Note in example 2 there are
some page corner fiducials that I don't think are printed.)

Given the title and subtitle for a contest, and the bounded area for a
contest, software could match the text at the leftmost top of the
extent. However, the example JSON example does not have the BallotTitle
or BallotSubtitle, e.g. "For President and Vice President" or "For
President and\nVice President". In example 2, we have a title/subtitle
"For County Commissioner"/"(Full term commencing 1-2-2021)". [Ohio uses
a term start date to label seats.]

The BallotDefinition has a vote-for number. We could configure a
validator to match specific phrasing, e.g. "(Vote for not more than
{{VotesAllowed}})". But some generic pattern matching could likely
figure this out.

In the case where there are running mates (2 candidates per option), we
have extra text to make the full title appearing on the ballot. We could
likewise configure the validator to expand the title text, e.g.
"For President\n{{Candidate1.BallotName}}\nFor Vice
President\n{{Candidate2.BallotName}}\n{{Party}}". A generic converter
could probably match a party name automatically.

Note one thing missing in the BallotDefinition schema is a way to
represent instructions that appear on the ballot in a contest heading,
e.g. "A vote for any candidates for President and Vice President shall
be a vote for the electors of those candidates whose names have been
certified to the Secretary of State.".

The BallotDefinition model allows an extent for a contest, but not for
ContestOption. This would be a useful addition for such a validator.
Probably a generic validator could figure it out where we assume a
candidate name begins the ContestOption area and we divide the
whitespace above the candidate name as top of the position. We can
validate the OptionPosition being inside the computed or defined
ContestOption extent.

For the Write-In area, we typically have a rule (fiducial) at an edge of
the write-in area. In Example 2, note there is also text added. We may
need to explicitly configure a validator to add text above/below a
write-in area.

One important thing missing from the BallotDefinition.OrderedContent
model is a way to define a location and BallotTitle for the ballot style
and precinct. In example 1 we have "Precinct 001-BRA" and example 2.
"BRK-A". There should be a way to define locations for the
human-readable idenfication. This is an important part of validation.

It would also be nice to add "Instructions", similar to header, but
instructions are a ballot area with more complex text, possibly with a
complex layout (could be multiple columns and include images). The board
of elections signature area might also be considered to be instructions.



Reply all
Reply to author
Forward
0 new messages