Post

Timetable Image AI Recognition and Prompt Improvement

Timetable Image AI Recognition and Prompt Improvement

Problem

For the Kakao Tech Campus final project, we built a student schedule management service. Manually entering timetables is tedious, so I wanted to auto-recognize them from uploaded images.


Approach: GPT Vision + Structured Output

I chose GPT-4.1’s Vision feature over traditional OCR. Why:

  • Timetable formats vary wildly (Everytime app, school websites, handwritten, etc.)
  • I needed structured data, not just raw text

I used GPT’s Structured Output to enforce the output format via JSON Schema.

unnamed (3).png


Prompt Design

At first, I went simple: “Convert this timetable image to JSON.” Results were all over the place. Maybe 2–3 accurate out of 10 tries.

After refining the prompt, I hit 8–9 accurate results out of 10.

Final Prompt Rules:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
1. dayOfWeek starts at 1 for Monday. (Mon=1, Tue=2, Wed=3, Thu=4, Fri=5)

2. startTime, endTime use "HH:MM:SS" format, 24-hour clock.

3. Same subject + professor + room should be grouped as one subject,
   with multiple time entries in the times list.

4. If credit isn't specified:
   - Regular lecture courses: 3
   - Lab/practice courses ('lab', 'practice', 'project', 'capstone', etc.): 2

5. If time isn't directly shown in the image, estimate based on grid spacing.

6. Infer class duration from the table. Don't assume 1 hour without evidence.

7. Start/end times may not be on the hour. Could be 5-minute intervals.

8. Enter all strings exactly as shown in the image.

Improvement Points

ProblemSolution
Always assumed 1-hour classesAdded “Don’t assume 1 hour without evidence”
Only guessed times on the hourAdded “Could be 5-minute intervals”
Same course split into multiple entriesAdded “Group same courses” rule
Returned 0 creditsAdded default credit rules by course type

Lessons Learned

  • AI output varies a lot depending on the prompt
  • Structured Output keeps parsing stable
  • Anticipate edge cases and bake them into the prompt

From Kakao Tech Campus 3rd cohort final project (student schedule management service).

This post is licensed under CC BY 4.0 by the author.